@fedify/fedify 1.8.1-pr.350.1285 → 1.8.2

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 (102) hide show
  1. package/README.md +2 -0
  2. package/dist/{actor-D_mYtQ--.js → actor-BoGD7NTN.js} +1 -1
  3. package/dist/{actor-CaMRRcub.js → actor-ByRaiOPo.js} +179 -179
  4. package/dist/{actor-C2nhWp6O.d.ts → actor-Uh1YDuVl.d.ts} +2 -2
  5. package/dist/{authdocloader-K0Peq1hX.js → authdocloader-B1xJIUPX.js} +6 -5
  6. package/dist/{authdocloader-CQh4IJfT.js → authdocloader-Bc6qZuGP.js} +6 -5
  7. package/dist/{builder-fPWs-TI4.js → builder-BfgGj1eY.js} +4 -4
  8. package/dist/{client-9cPnAibf.js → client-CroFXpdD.js} +1 -1
  9. package/dist/{client-D2tgjFk3.d.ts → client-DF8anIB5.d.ts} +1 -1
  10. package/dist/compat/mod.d.ts +10 -10
  11. package/dist/compat/transformers.test.js +16 -16
  12. package/dist/{context-BBD2ZH_P.d.ts → context-CnveeHUR.d.ts} +8 -8
  13. package/dist/{docloader-BBtyRca1.js → docloader-BrWrLf03.js} +23 -27
  14. package/dist/{docloader-Bz56sKV5.d.ts → docloader-CxWcuWqQ.d.ts} +14 -1
  15. package/dist/{esm-QBbiQNo4.js → esm-C3x3cFms.js} +1 -1
  16. package/dist/federation/builder.test.js +5 -5
  17. package/dist/federation/collection.test.js +3 -3
  18. package/dist/federation/handler.test.js +17 -17
  19. package/dist/federation/inbox.test.js +4 -4
  20. package/dist/federation/keycache.test.js +4 -4
  21. package/dist/federation/kv.test.js +3 -3
  22. package/dist/federation/middleware.test.js +18 -18
  23. package/dist/federation/mod.d.ts +9 -9
  24. package/dist/federation/mod.js +10 -10
  25. package/dist/federation/mq.test.js +3 -3
  26. package/dist/federation/retry.test.js +3 -3
  27. package/dist/federation/router.test.js +3 -3
  28. package/dist/federation/send.test.js +10 -10
  29. package/dist/{http-DWJVfkyZ.js → http-C9jtl8Fq.js} +12 -6
  30. package/dist/{http-l4uEvaAw.d.ts → http-DtG44GdM.d.ts} +2 -2
  31. package/dist/{http-B0NkMLuT.js → http-HwvmocJz.js} +11 -5
  32. package/dist/{inbox-B1nIxc0q.js → inbox-DKVTIbmv.js} +1 -1
  33. package/dist/{key-Bpdjmig5.js → key-E7rSdqc6.js} +2 -2
  34. package/dist/{key-BRl4AtNh.js → key-UWXjce4t.js} +2 -2
  35. package/dist/{key-CKINuzqT.js → key-cBIF6vMv.js} +4 -4
  36. package/dist/{key-BDCSCae-.js → key-moR6gVPP.js} +3 -3
  37. package/dist/{keycache-CoDCGPU_.js → keycache-CwnMs7kD.js} +1 -1
  38. package/dist/{keys--rBfRBtT.js → keys-CuWK2Y03.js} +1 -1
  39. package/dist/{ld-C3oVh0YJ.js → ld-xAUJDa7n.js} +2 -2
  40. package/dist/{lookup-BJelGpWr.d.ts → lookup-3czM5mmU.d.ts} +7 -1
  41. package/dist/{lookup-BxBwlMQM.js → lookup-B4W3OzUX.js} +3 -2
  42. package/dist/{lookup-BLwnybnA.js → lookup-CVtBGpmR.js} +5 -4
  43. package/dist/middleware-B6ScuRgA.js +17 -0
  44. package/dist/middleware-CHHEn4gi.js +26 -0
  45. package/dist/{middleware-KK44603T.js → middleware-CXt-a6dH.js} +10 -10
  46. package/dist/{middleware-hQ-rKnGR.js → middleware-PabOxUwx.js} +13 -13
  47. package/dist/{mod-DDwnlIlm.d.ts → mod-DPpunL8j.d.ts} +2 -2
  48. package/dist/{mod-D79SaXL-.d.ts → mod-cz-tNIqP.d.ts} +7 -2
  49. package/dist/{mod-DM7ZpXF4.d.ts → mod-mSMqo9JU.d.ts} +2 -2
  50. package/dist/{mod-DwquBB1g.d.ts → mod-tQVUxQ_D.d.ts} +3 -3
  51. package/dist/mod.d.ts +12 -12
  52. package/dist/mod.js +10 -10
  53. package/dist/nodeinfo/client.test.js +5 -5
  54. package/dist/nodeinfo/handler.test.js +16 -16
  55. package/dist/nodeinfo/mod.d.ts +2 -2
  56. package/dist/nodeinfo/mod.js +2 -2
  57. package/dist/nodeinfo/semver.test.js +3 -3
  58. package/dist/nodeinfo/types.test.js +3 -3
  59. package/dist/{owner-fFqUg4lq.d.ts → owner-C12klfeG.d.ts} +3 -3
  60. package/dist/{owner-D42JugRm.js → owner-D5KsHyuV.js} +2 -2
  61. package/dist/{proof-CIm_fnDK.js → proof-Bblo4Nm-.js} +2 -2
  62. package/dist/{proof-wEvE3AbS.js → proof-YncewGYN.js} +3 -3
  63. package/dist/runtime/authdocloader.test.js +49 -9
  64. package/dist/runtime/docloader.test.js +60 -4
  65. package/dist/runtime/key.test.js +5 -5
  66. package/dist/runtime/langstr.test.js +3 -3
  67. package/dist/runtime/mod.d.ts +4 -4
  68. package/dist/runtime/mod.js +6 -6
  69. package/dist/runtime/multibase/multibase.test.js +3 -3
  70. package/dist/runtime/url.test.js +3 -3
  71. package/dist/{send-BRA7aMRV.js → send-BZTUiPC7.js} +2 -2
  72. package/dist/sig/http.test.js +51 -9
  73. package/dist/sig/key.test.js +6 -6
  74. package/dist/sig/ld.test.js +7 -7
  75. package/dist/sig/mod.d.ts +6 -6
  76. package/dist/sig/mod.js +6 -6
  77. package/dist/sig/owner.test.js +7 -7
  78. package/dist/sig/proof.test.js +7 -7
  79. package/dist/testing/docloader.test.js +3 -3
  80. package/dist/testing/mod.d.ts +24 -1
  81. package/dist/testing/mod.js +3 -3
  82. package/dist/{testing-C7zAnwt8.js → testing-DaL6N_nG.js} +3 -3
  83. package/dist/{type-gkozZs_Y.js → type-Bajikogy.js} +202 -205
  84. package/dist/{types-YGkwBxol.js → types-BuS81dTB.js} +1 -1
  85. package/dist/vocab/actor.test.js +5 -5
  86. package/dist/vocab/lookup.test.js +98 -6
  87. package/dist/vocab/mod.d.ts +4 -4
  88. package/dist/vocab/mod.js +4 -4
  89. package/dist/vocab/type.test.js +3 -3
  90. package/dist/vocab/vocab.test.js +4 -4
  91. package/dist/{vocab-CA7YwVEz.d.ts → vocab-Ukxjz3TM.d.ts} +1 -1
  92. package/dist/{vocab-DQ4SEIWh.js → vocab-kRG6ecFm.js} +7 -6
  93. package/dist/webfinger/handler.test.js +16 -16
  94. package/dist/webfinger/lookup.test.js +58 -4
  95. package/dist/webfinger/mod.d.ts +2 -2
  96. package/dist/webfinger/mod.js +2 -2
  97. package/dist/x/cfworkers.test.js +3 -3
  98. package/dist/x/hono.d.ts +9 -9
  99. package/dist/x/sveltekit.d.ts +9 -9
  100. package/package.json +1 -1
  101. package/dist/middleware-BEG0MAZG.js +0 -26
  102. package/dist/middleware-BtSPPgam.js +0 -17
@@ -2,7 +2,7 @@
2
2
  import { Temporal } from "@js-temporal/polyfill";
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
 
5
- import { getUserAgent } from "./docloader-BBtyRca1.js";
5
+ import { getUserAgent } from "./docloader-BrWrLf03.js";
6
6
  import { getLogger } from "@logtape/logtape";
7
7
 
8
8
  //#region src/nodeinfo/semver.ts
@@ -3,19 +3,19 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { Application, Group, Organization, Person, Service, __export } from "../type-gkozZs_Y.js";
6
+ import { Application, Group, Organization, Person, Service, __export } from "../type-Bajikogy.js";
7
7
  import { assertEquals } from "../assert_equals-DSbWqCm3.js";
8
8
  import { assert } from "../assert-MZs1qjMx.js";
9
9
  import "../assert_instance_of-DHz7EHNU.js";
10
- import "../lookup-BLwnybnA.js";
11
- import { getActorClassByTypeName, getActorHandle, getActorTypeName, isActor, normalizeActorHandle } from "../actor-D_mYtQ--.js";
12
- import { test } from "../testing-C7zAnwt8.js";
10
+ import "../lookup-CVtBGpmR.js";
11
+ import { getActorClassByTypeName, getActorHandle, getActorTypeName, isActor, normalizeActorHandle } from "../actor-BoGD7NTN.js";
12
+ import { test } from "../testing-DaL6N_nG.js";
13
13
  import { assertStrictEquals } from "../std__assert-X-_kMxKM.js";
14
14
  import { assertFalse, assertRejects } from "../assert_rejects-DiIiJbZn.js";
15
15
  import "../assert_is_error-BPGph1Jx.js";
16
16
  import "../assert_not_equals-f3m3epl3.js";
17
17
  import { assertThrows } from "../assert_throws-BOO88avQ.js";
18
- import { esm_default } from "../esm-QBbiQNo4.js";
18
+ import { esm_default } from "../esm-C3x3cFms.js";
19
19
 
20
20
  //#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/check/precondition/PreconditionFailure.js
21
21
  var PreconditionFailure = class PreconditionFailure extends Error {
@@ -3,21 +3,24 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { Collection, Note, Object as Object$1, Person } from "../type-gkozZs_Y.js";
6
+ import { Collection, Note, Object as Object$1, Person } from "../type-Bajikogy.js";
7
7
  import { assertEquals } from "../assert_equals-DSbWqCm3.js";
8
8
  import "../assert-MZs1qjMx.js";
9
9
  import { assertInstanceOf } from "../assert_instance_of-DHz7EHNU.js";
10
- import { lookupObject, traverseCollection } from "../lookup-BLwnybnA.js";
11
- import { mockDocumentLoader, test } from "../testing-C7zAnwt8.js";
10
+ import { lookupObject, traverseCollection } from "../lookup-CVtBGpmR.js";
11
+ import { mockDocumentLoader, test } from "../testing-DaL6N_nG.js";
12
12
  import "../std__assert-X-_kMxKM.js";
13
13
  import "../assert_rejects-DiIiJbZn.js";
14
14
  import "../assert_is_error-BPGph1Jx.js";
15
15
  import "../assert_not_equals-f3m3epl3.js";
16
16
  import "../assert_throws-BOO88avQ.js";
17
- import { esm_default } from "../esm-QBbiQNo4.js";
17
+ import { esm_default } from "../esm-C3x3cFms.js";
18
18
 
19
19
  //#region src/vocab/lookup.test.ts
20
- test("lookupObject()", async (t) => {
20
+ test("lookupObject()", {
21
+ sanitizeResources: false,
22
+ sanitizeOps: false
23
+ }, async (t) => {
21
24
  esm_default.spyGlobal();
22
25
  esm_default.get("begin:https://example.com/.well-known/webfinger", {
23
26
  subject: "acct:johndoe@example.com",
@@ -80,9 +83,98 @@ test("lookupObject()", async (t) => {
80
83
  assertEquals(await lookupObject("janedoe@example.com", options), null);
81
84
  assertEquals(await lookupObject("https://example.com/404", options), null);
82
85
  });
86
+ esm_default.removeRoutes();
87
+ esm_default.get("begin:https://example.com/.well-known/webfinger", () => new Promise((resolve) => {
88
+ setTimeout(() => {
89
+ resolve({
90
+ subject: "acct:johndoe@example.com",
91
+ links: [{
92
+ rel: "self",
93
+ href: "https://example.com/person",
94
+ type: "application/activity+json"
95
+ }]
96
+ });
97
+ }, 1e3);
98
+ }));
99
+ await t.step("request cancellation", async () => {
100
+ const controller = new AbortController();
101
+ const promise = lookupObject("johndoe@example.com", {
102
+ ...options,
103
+ signal: controller.signal
104
+ });
105
+ controller.abort();
106
+ assertEquals(await promise, null);
107
+ });
108
+ esm_default.removeRoutes();
109
+ esm_default.get("begin:https://example.com/.well-known/webfinger", {
110
+ subject: "acct:johndoe@example.com",
111
+ links: [{
112
+ rel: "self",
113
+ href: "https://example.com/person",
114
+ type: "application/activity+json"
115
+ }]
116
+ });
117
+ await t.step("successful request with signal", async () => {
118
+ const controller = new AbortController();
119
+ const person = await lookupObject("johndoe@example.com", {
120
+ ...options,
121
+ signal: controller.signal
122
+ });
123
+ assertInstanceOf(person, Person);
124
+ assertEquals(person.id, new URL("https://example.com/person"));
125
+ });
126
+ esm_default.removeRoutes();
127
+ esm_default.get("begin:https://example.com/.well-known/webfinger", () => new Promise((resolve) => {
128
+ setTimeout(() => {
129
+ resolve({
130
+ subject: "acct:johndoe@example.com",
131
+ links: [{
132
+ rel: "self",
133
+ href: "https://example.com/person",
134
+ type: "application/activity+json"
135
+ }]
136
+ });
137
+ }, 500);
138
+ }));
139
+ await t.step("cancellation with immediate abort", async () => {
140
+ const controller = new AbortController();
141
+ controller.abort();
142
+ const result = await lookupObject("johndoe@example.com", {
143
+ ...options,
144
+ signal: controller.signal
145
+ });
146
+ assertEquals(result, null);
147
+ });
148
+ esm_default.removeRoutes();
149
+ esm_default.get("https://example.com/slow-object", () => new Promise((resolve) => {
150
+ setTimeout(() => {
151
+ resolve({
152
+ status: 200,
153
+ headers: { "Content-Type": "application/activity+json" },
154
+ body: {
155
+ "@context": "https://www.w3.org/ns/activitystreams",
156
+ type: "Note",
157
+ content: "Slow response"
158
+ }
159
+ });
160
+ }, 1e3);
161
+ }));
162
+ await t.step("direct object fetch cancellation", async () => {
163
+ const controller = new AbortController();
164
+ const promise = lookupObject("https://example.com/slow-object", {
165
+ contextLoader: mockDocumentLoader,
166
+ signal: controller.signal
167
+ });
168
+ controller.abort();
169
+ assertEquals(await promise, null);
170
+ });
83
171
  esm_default.hardReset();
172
+ esm_default.removeRoutes();
84
173
  });
85
- test("traverseCollection()", async () => {
174
+ test("traverseCollection()", {
175
+ sanitizeResources: false,
176
+ sanitizeOps: false
177
+ }, async () => {
86
178
  const options = {
87
179
  documentLoader: mockDocumentLoader,
88
180
  contextLoader: mockDocumentLoader
@@ -1,8 +1,8 @@
1
1
  import { Temporal } from "@js-temporal/polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
3
  import "../kv-C7sopW2E.js";
4
- import "../docloader-Bz56sKV5.js";
5
- import { 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, Leave, Like, Link, Listen, Mention, Move, Multikey, Note, Object as Object$1, Offer, OrderedCollection, OrderedCollectionPage, Organization, Page, Person, Place, Profile, PropertyValue, Question, Read, Reject, Relationship, Remove, Service, Source, TentativeAccept, TentativeReject, Tombstone, Travel, Undo, Update, Video, View } from "../vocab-CA7YwVEz.js";
6
- import { Actor, ActorTypeName, GetActorHandleOptions, NormalizeActorHandleOptions, Recipient, getActorClassByTypeName, getActorHandle, getActorTypeName, isActor, normalizeActorHandle } from "../actor-C2nhWp6O.js";
7
- import { FediverseHandle, LookupObjectOptions, PUBLIC_COLLECTION, TraverseCollectionOptions, getTypeId, isFediverseHandle, lookupObject, parseFediverseHandle, toAcctUrl, traverseCollection } from "../mod-D79SaXL-.js";
4
+ import "../docloader-CxWcuWqQ.js";
5
+ import { 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, Leave, Like, Link, Listen, Mention, Move, Multikey, Note, Object as Object$1, Offer, OrderedCollection, OrderedCollectionPage, Organization, Page, Person, Place, Profile, PropertyValue, Question, Read, Reject, Relationship, Remove, Service, Source, TentativeAccept, TentativeReject, Tombstone, Travel, Undo, Update, Video, View } from "../vocab-Ukxjz3TM.js";
6
+ import { Actor, ActorTypeName, GetActorHandleOptions, NormalizeActorHandleOptions, Recipient, getActorClassByTypeName, getActorHandle, getActorTypeName, isActor, normalizeActorHandle } from "../actor-Uh1YDuVl.js";
7
+ import { FediverseHandle, LookupObjectOptions, PUBLIC_COLLECTION, TraverseCollectionOptions, getTypeId, isFediverseHandle, lookupObject, parseFediverseHandle, toAcctUrl, traverseCollection } from "../mod-cz-tNIqP.js";
8
8
  export { Accept, Activity, Actor, ActorTypeName, Add, Announce, Application, Arrive, Article, Audio, Block, ChatMessage, Collection, CollectionPage, Create, CryptographicKey, DataIntegrityProof, Delete, DidService, Dislike, Document, Emoji, EmojiReact, Endpoints, Event, Export, FediverseHandle, Flag, Follow, GetActorHandleOptions, Group, Hashtag, Ignore, Image, IntransitiveActivity, Invite, Join, Leave, Like, Link, Listen, LookupObjectOptions, Mention, Move, Multikey, NormalizeActorHandleOptions, Note, Object$1 as Object, Offer, OrderedCollection, OrderedCollectionPage, Organization, PUBLIC_COLLECTION, Page, Person, Place, Profile, PropertyValue, Question, Read, Recipient, Reject, Relationship, Remove, Service, Source, TentativeAccept, TentativeReject, Tombstone, Travel, TraverseCollectionOptions, Undo, Update, Video, View, getActorClassByTypeName, getActorHandle, getActorTypeName, getTypeId, isActor, isFediverseHandle, lookupObject, normalizeActorHandle, parseFediverseHandle, toAcctUrl, traverseCollection };
package/dist/vocab/mod.js CHANGED
@@ -2,9 +2,9 @@
2
2
  import { Temporal } from "@js-temporal/polyfill";
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
 
5
- import "../docloader-BBtyRca1.js";
6
- import { 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, Leave, Like, Link, Listen, Mention, Move, Multikey, Note, Object as Object$1, Offer, OrderedCollection, OrderedCollectionPage, Organization, Page, Person, Place, Profile, PropertyValue, Question, Read, Reject, Relationship, Remove, Service, Source, TentativeAccept, TentativeReject, Tombstone, Travel, Undo, Update, Video, View, getActorClassByTypeName, getActorHandle, getActorTypeName, getTypeId, isActor, normalizeActorHandle } from "../actor-CaMRRcub.js";
7
- import "../lookup-BxBwlMQM.js";
8
- import { PUBLIC_COLLECTION, isFediverseHandle, lookupObject, parseFediverseHandle, toAcctUrl, traverseCollection } from "../vocab-DQ4SEIWh.js";
5
+ import "../docloader-BrWrLf03.js";
6
+ import { 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, Leave, Like, Link, Listen, Mention, Move, Multikey, Note, Object as Object$1, Offer, OrderedCollection, OrderedCollectionPage, Organization, Page, Person, Place, Profile, PropertyValue, Question, Read, Reject, Relationship, Remove, Service, Source, TentativeAccept, TentativeReject, Tombstone, Travel, Undo, Update, Video, View, getActorClassByTypeName, getActorHandle, getActorTypeName, getTypeId, isActor, normalizeActorHandle } from "../actor-ByRaiOPo.js";
7
+ import "../lookup-B4W3OzUX.js";
8
+ import { PUBLIC_COLLECTION, isFediverseHandle, lookupObject, parseFediverseHandle, toAcctUrl, traverseCollection } from "../vocab-kRG6ecFm.js";
9
9
 
10
10
  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, Leave, Like, Link, Listen, Mention, Move, Multikey, Note, Object$1 as Object, Offer, OrderedCollection, OrderedCollectionPage, Organization, PUBLIC_COLLECTION, Page, Person, Place, Profile, PropertyValue, Question, Read, Reject, Relationship, Remove, Service, Source, TentativeAccept, TentativeReject, Tombstone, Travel, Undo, Update, Video, View, getActorClassByTypeName, getActorHandle, getActorTypeName, getTypeId, isActor, isFediverseHandle, lookupObject, normalizeActorHandle, parseFediverseHandle, toAcctUrl, traverseCollection };
@@ -3,10 +3,10 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { Person, getTypeId } from "../type-gkozZs_Y.js";
6
+ import { Person, getTypeId } from "../type-Bajikogy.js";
7
7
  import { assertEquals } from "../assert_equals-DSbWqCm3.js";
8
- import "../lookup-BLwnybnA.js";
9
- import { test } from "../testing-C7zAnwt8.js";
8
+ import "../lookup-CVtBGpmR.js";
9
+ import { test } from "../testing-DaL6N_nG.js";
10
10
 
11
11
  //#region src/vocab/type.test.ts
12
12
  test("getTypeId()", () => {
@@ -3,18 +3,18 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { Activity, Announce, Create, CryptographicKey, Follow, Hashtag, LanguageString, Note, Object as Object$1, OrderedCollectionPage, Person, Place, Question, Source, decode, vocab_exports } from "../type-gkozZs_Y.js";
6
+ import { Activity, Announce, Create, CryptographicKey, Follow, Hashtag, LanguageString, Note, Object as Object$1, OrderedCollectionPage, Person, Place, Question, Source, decode, vocab_exports } from "../type-Bajikogy.js";
7
7
  import { assertEquals } from "../assert_equals-DSbWqCm3.js";
8
8
  import { assert } from "../assert-MZs1qjMx.js";
9
9
  import { assertInstanceOf } from "../assert_instance_of-DHz7EHNU.js";
10
- import "../lookup-BLwnybnA.js";
11
- import { mockDocumentLoader, test } from "../testing-C7zAnwt8.js";
10
+ import "../lookup-CVtBGpmR.js";
11
+ import { mockDocumentLoader, test } from "../testing-DaL6N_nG.js";
12
12
  import "../std__assert-X-_kMxKM.js";
13
13
  import { assertFalse, assertRejects } from "../assert_rejects-DiIiJbZn.js";
14
14
  import "../assert_is_error-BPGph1Jx.js";
15
15
  import { assertNotEquals } from "../assert_not_equals-f3m3epl3.js";
16
16
  import { assertThrows } from "../assert_throws-BOO88avQ.js";
17
- import { ed25519PublicKey, rsaPublicKey1 } from "../keys--rBfRBtT.js";
17
+ import { ed25519PublicKey, rsaPublicKey1 } from "../keys-CuWK2Y03.js";
18
18
  import { pascalCase } from "es-toolkit";
19
19
  import { parseLanguageTag } from "@phensley/language-tag";
20
20
  import { Validator } from "@cfworker/json-schema";
@@ -1,6 +1,6 @@
1
1
  import { Temporal } from "@js-temporal/polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
- import { DocumentLoader } from "./docloader-Bz56sKV5.js";
3
+ import { DocumentLoader } from "./docloader-CxWcuWqQ.js";
4
4
  import { Span, TracerProvider } from "@opentelemetry/api";
5
5
  import { LanguageTag } from "@phensley/language-tag";
6
6
 
@@ -2,9 +2,9 @@
2
2
  import { Temporal } from "@js-temporal/polyfill";
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
 
5
- import { deno_default, getDocumentLoader } from "./docloader-BBtyRca1.js";
6
- import { Object as Object$1, getTypeId } from "./actor-CaMRRcub.js";
7
- import { lookupWebFinger } from "./lookup-BxBwlMQM.js";
5
+ import { deno_default, getDocumentLoader } from "./docloader-BrWrLf03.js";
6
+ import { Object as Object$1, getTypeId } from "./actor-ByRaiOPo.js";
7
+ import { lookupWebFinger } from "./lookup-B4W3OzUX.js";
8
8
  import { getLogger } from "@logtape/logtape";
9
9
  import { SpanStatusCode, trace } from "@opentelemetry/api";
10
10
  import { delay } from "es-toolkit";
@@ -154,7 +154,7 @@ async function lookupObjectInternal(identifier, options = {}) {
154
154
  if (typeof identifier === "string") identifier = toAcctUrl(identifier) ?? new URL(identifier);
155
155
  let document = null;
156
156
  if (identifier.protocol === "http:" || identifier.protocol === "https:") try {
157
- const remoteDoc = await documentLoader(identifier.href);
157
+ const remoteDoc = await documentLoader(identifier.href, { signal: options.signal });
158
158
  document = remoteDoc.document;
159
159
  } catch (error) {
160
160
  logger.debug("Failed to fetch remote document:\n{error}", { error });
@@ -163,13 +163,14 @@ async function lookupObjectInternal(identifier, options = {}) {
163
163
  const jrd = await lookupWebFinger(identifier, {
164
164
  userAgent: options.userAgent,
165
165
  tracerProvider: options.tracerProvider,
166
- allowPrivateAddress: "allowPrivateAddress" in options && options.allowPrivateAddress === true
166
+ allowPrivateAddress: "allowPrivateAddress" in options && options.allowPrivateAddress === true,
167
+ signal: options.signal
167
168
  });
168
169
  if (jrd?.links == null) return null;
169
170
  for (const l of jrd.links) {
170
171
  if (l.type !== "application/activity+json" && !l.type?.match(/application\/ld\+json;\s*profile="https:\/\/www.w3.org\/ns\/activitystreams"/) || l.rel !== "self") continue;
171
172
  try {
172
- const remoteDoc = await documentLoader(l.href);
173
+ const remoteDoc = await documentLoader(l.href, { signal: options.signal });
173
174
  document = remoteDoc.document;
174
175
  break;
175
176
  } catch (error) {
@@ -3,30 +3,30 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { Image, Link, Person } from "../type-gkozZs_Y.js";
6
+ import { Image, Link, Person } from "../type-Bajikogy.js";
7
7
  import { assertEquals } from "../assert_equals-DSbWqCm3.js";
8
8
  import "../assert-MZs1qjMx.js";
9
9
  import "../assert_instance_of-DHz7EHNU.js";
10
10
  import { MemoryKvStore } from "../kv-CRZrzyXm.js";
11
- import { createFederation, handleWebFinger } from "../middleware-hQ-rKnGR.js";
11
+ import { createFederation, handleWebFinger } from "../middleware-PabOxUwx.js";
12
12
  import "../semver-dArNLkR9.js";
13
- import "../client-9cPnAibf.js";
14
- import "../lookup-BLwnybnA.js";
13
+ import "../client-CroFXpdD.js";
14
+ import "../lookup-CVtBGpmR.js";
15
15
  import "../types-BIgY6c-l.js";
16
- import "../actor-D_mYtQ--.js";
17
- import "../key-Bpdjmig5.js";
18
- import "../http-B0NkMLuT.js";
19
- import "../authdocloader-CQh4IJfT.js";
20
- import "../ld-C3oVh0YJ.js";
21
- import "../owner-D42JugRm.js";
22
- import "../proof-CIm_fnDK.js";
23
- import "../inbox-B1nIxc0q.js";
24
- import "../builder-fPWs-TI4.js";
16
+ import "../actor-BoGD7NTN.js";
17
+ import "../key-E7rSdqc6.js";
18
+ import "../http-HwvmocJz.js";
19
+ import "../authdocloader-Bc6qZuGP.js";
20
+ import "../ld-xAUJDa7n.js";
21
+ import "../owner-D5KsHyuV.js";
22
+ import "../proof-Bblo4Nm-.js";
23
+ import "../inbox-DKVTIbmv.js";
24
+ import "../builder-BfgGj1eY.js";
25
25
  import "../collection-CSzG2j1P.js";
26
- import "../keycache-CoDCGPU_.js";
26
+ import "../keycache-CwnMs7kD.js";
27
27
  import "../retry-D4GJ670a.js";
28
- import "../send-BRA7aMRV.js";
29
- import { createRequestContext, test } from "../testing-C7zAnwt8.js";
28
+ import "../send-BZTUiPC7.js";
29
+ import { createRequestContext, test } from "../testing-DaL6N_nG.js";
30
30
  import "../std__assert-X-_kMxKM.js";
31
31
  import "../assert_rejects-DiIiJbZn.js";
32
32
  import "../assert_is_error-BPGph1Jx.js";
@@ -3,18 +3,18 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { lookupWebFinger } from "../type-gkozZs_Y.js";
6
+ import { lookupWebFinger } from "../type-Bajikogy.js";
7
7
  import { assertEquals } from "../assert_equals-DSbWqCm3.js";
8
8
  import "../assert-MZs1qjMx.js";
9
9
  import "../assert_instance_of-DHz7EHNU.js";
10
- import "../lookup-BLwnybnA.js";
11
- import { test } from "../testing-C7zAnwt8.js";
10
+ import "../lookup-CVtBGpmR.js";
11
+ import { test } from "../testing-DaL6N_nG.js";
12
12
  import "../std__assert-X-_kMxKM.js";
13
13
  import "../assert_rejects-DiIiJbZn.js";
14
14
  import "../assert_is_error-BPGph1Jx.js";
15
15
  import "../assert_not_equals-f3m3epl3.js";
16
16
  import "../assert_throws-BOO88avQ.js";
17
- import { esm_default } from "../esm-QBbiQNo4.js";
17
+ import { esm_default } from "../esm-C3x3cFms.js";
18
18
  import { withTimeout } from "es-toolkit";
19
19
 
20
20
  //#region src/webfinger/lookup.test.ts
@@ -134,6 +134,60 @@ test({
134
134
  redirectCount = 0;
135
135
  assertEquals(await lookupWebFinger("acct:johndoe@example.com"), expected);
136
136
  });
137
+ esm_default.removeRoutes();
138
+ esm_default.get("begin:https://example.com/.well-known/webfinger?", () => new Promise((resolve) => {
139
+ const timeoutId = setTimeout(() => {
140
+ resolve({ body: expected });
141
+ }, 1e3);
142
+ return () => clearTimeout(timeoutId);
143
+ }));
144
+ await t.step("request cancellation", async () => {
145
+ const controller = new AbortController();
146
+ const promise = lookupWebFinger("acct:johndoe@example.com", { signal: controller.signal });
147
+ controller.abort();
148
+ assertEquals(await promise, null);
149
+ });
150
+ esm_default.removeRoutes();
151
+ let redirectCount2 = 0;
152
+ esm_default.get("begin:https://example.com/.well-known/webfinger", () => {
153
+ redirectCount2++;
154
+ if (redirectCount2 === 1) return {
155
+ status: 302,
156
+ headers: { Location: "/.well-known/webfinger2" }
157
+ };
158
+ return new Promise((resolve) => {
159
+ const timeoutId = setTimeout(() => {
160
+ resolve({ body: expected });
161
+ }, 1e3);
162
+ return () => clearTimeout(timeoutId);
163
+ });
164
+ });
165
+ await t.step("cancellation during redirection", async () => {
166
+ const controller = new AbortController();
167
+ const promise = lookupWebFinger("acct:johndoe@example.com", { signal: controller.signal });
168
+ setTimeout(() => controller.abort(), 100);
169
+ assertEquals(await promise, null);
170
+ });
171
+ esm_default.removeRoutes();
172
+ esm_default.get("begin:https://example.com/.well-known/webfinger?", () => new Promise((resolve) => {
173
+ const timeoutId = setTimeout(() => {
174
+ resolve({ body: expected });
175
+ }, 500);
176
+ return () => clearTimeout(timeoutId);
177
+ }));
178
+ await t.step("cancellation with immediate abort", async () => {
179
+ const controller = new AbortController();
180
+ controller.abort();
181
+ const result = await lookupWebFinger("acct:johndoe@example.com", { signal: controller.signal });
182
+ assertEquals(result, null);
183
+ });
184
+ esm_default.removeRoutes();
185
+ esm_default.get("begin:https://example.com/.well-known/webfinger?", { body: expected });
186
+ await t.step("successful request with signal", async () => {
187
+ const controller = new AbortController();
188
+ const result = await lookupWebFinger("acct:johndoe@example.com", { signal: controller.signal });
189
+ assertEquals(result, expected);
190
+ });
137
191
  esm_default.hardReset();
138
192
  }
139
193
  });
@@ -1,7 +1,7 @@
1
1
  import { Temporal } from "@js-temporal/polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
3
  import "../kv-C7sopW2E.js";
4
- import "../docloader-Bz56sKV5.js";
5
- import { Link, LookupWebFingerOptions, ResourceDescriptor, lookupWebFinger } from "../lookup-BJelGpWr.js";
4
+ import "../docloader-CxWcuWqQ.js";
5
+ import { Link, LookupWebFingerOptions, ResourceDescriptor, lookupWebFinger } from "../lookup-3czM5mmU.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-BBtyRca1.js";
6
- import { lookupWebFinger } from "../lookup-BxBwlMQM.js";
5
+ import "../docloader-BrWrLf03.js";
6
+ import { lookupWebFinger } from "../lookup-B4W3OzUX.js";
7
7
  import "../webfinger-C3GIyXIg.js";
8
8
 
9
9
  export { lookupWebFinger };
@@ -3,12 +3,12 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import "../type-gkozZs_Y.js";
6
+ import "../type-Bajikogy.js";
7
7
  import { assertEquals } from "../assert_equals-DSbWqCm3.js";
8
8
  import "../assert-MZs1qjMx.js";
9
9
  import "../assert_instance_of-DHz7EHNU.js";
10
- import "../lookup-BLwnybnA.js";
11
- import { test } from "../testing-C7zAnwt8.js";
10
+ import "../lookup-CVtBGpmR.js";
11
+ import { test } from "../testing-DaL6N_nG.js";
12
12
  import "../std__assert-X-_kMxKM.js";
13
13
  import "../assert_rejects-DiIiJbZn.js";
14
14
  import "../assert_is_error-BPGph1Jx.js";
package/dist/x/hono.d.ts CHANGED
@@ -1,15 +1,15 @@
1
1
  import { Temporal } from "@js-temporal/polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
3
  import "../kv-C7sopW2E.js";
4
- import "../docloader-Bz56sKV5.js";
5
- import "../client-D2tgjFk3.js";
6
- import "../vocab-CA7YwVEz.js";
7
- import "../actor-C2nhWp6O.js";
8
- import "../http-l4uEvaAw.js";
9
- import "../owner-fFqUg4lq.js";
10
- import "../mod-D79SaXL-.js";
11
- import "../lookup-BJelGpWr.js";
12
- import { Federation } from "../context-BBD2ZH_P.js";
4
+ import "../docloader-CxWcuWqQ.js";
5
+ import "../client-DF8anIB5.js";
6
+ import "../vocab-Ukxjz3TM.js";
7
+ import "../actor-Uh1YDuVl.js";
8
+ import "../http-DtG44GdM.js";
9
+ import "../owner-C12klfeG.js";
10
+ import "../mod-cz-tNIqP.js";
11
+ import "../lookup-3czM5mmU.js";
12
+ import { Federation } from "../context-CnveeHUR.js";
13
13
  import "../mq-CRGm1e_F.js";
14
14
 
15
15
  //#region src/x/hono.d.ts
@@ -1,15 +1,15 @@
1
1
  import { Temporal } from "@js-temporal/polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
3
  import "../kv-C7sopW2E.js";
4
- import "../docloader-Bz56sKV5.js";
5
- import "../client-D2tgjFk3.js";
6
- import "../vocab-CA7YwVEz.js";
7
- import "../actor-C2nhWp6O.js";
8
- import "../http-l4uEvaAw.js";
9
- import "../owner-fFqUg4lq.js";
10
- import "../mod-D79SaXL-.js";
11
- import "../lookup-BJelGpWr.js";
12
- import { Federation } from "../context-BBD2ZH_P.js";
4
+ import "../docloader-CxWcuWqQ.js";
5
+ import "../client-DF8anIB5.js";
6
+ import "../vocab-Ukxjz3TM.js";
7
+ import "../actor-Uh1YDuVl.js";
8
+ import "../http-DtG44GdM.js";
9
+ import "../owner-C12klfeG.js";
10
+ import "../mod-cz-tNIqP.js";
11
+ import "../lookup-3czM5mmU.js";
12
+ import { Federation } from "../context-CnveeHUR.js";
13
13
  import "../mq-CRGm1e_F.js";
14
14
 
15
15
  //#region src/x/sveltekit.d.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fedify/fedify",
3
- "version": "1.8.1-pr.350.1285+2f8c4b37",
3
+ "version": "1.8.2",
4
4
  "description": "An ActivityPub server framework",
5
5
  "keywords": [
6
6
  "ActivityPub",
@@ -1,26 +0,0 @@
1
-
2
- import { Temporal } from "@js-temporal/polyfill";
3
- import { URLPattern } from "urlpattern-polyfill";
4
- globalThis.addEventListener = () => {};
5
-
6
- import "./type-gkozZs_Y.js";
7
- import { ContextImpl, FederationImpl, InboxContextImpl, KvSpecDeterminer, createFederation } from "./middleware-hQ-rKnGR.js";
8
- import "./semver-dArNLkR9.js";
9
- import "./client-9cPnAibf.js";
10
- import "./lookup-BLwnybnA.js";
11
- import "./types-BIgY6c-l.js";
12
- import "./actor-D_mYtQ--.js";
13
- import "./key-Bpdjmig5.js";
14
- import "./http-B0NkMLuT.js";
15
- import "./authdocloader-CQh4IJfT.js";
16
- import "./ld-C3oVh0YJ.js";
17
- import "./owner-D42JugRm.js";
18
- import "./proof-CIm_fnDK.js";
19
- import "./inbox-B1nIxc0q.js";
20
- import "./builder-fPWs-TI4.js";
21
- import "./collection-CSzG2j1P.js";
22
- import "./keycache-CoDCGPU_.js";
23
- import "./retry-D4GJ670a.js";
24
- import "./send-BRA7aMRV.js";
25
-
26
- export { FederationImpl };
@@ -1,17 +0,0 @@
1
-
2
- import { Temporal } from "@js-temporal/polyfill";
3
- import { URLPattern } from "urlpattern-polyfill";
4
-
5
- import "./transformers-Dna8Fg7k.js";
6
- import "./docloader-BBtyRca1.js";
7
- import "./actor-CaMRRcub.js";
8
- import { ContextImpl, FederationImpl, InboxContextImpl, KvSpecDeterminer, createFederation } from "./middleware-KK44603T.js";
9
- import "./lookup-BxBwlMQM.js";
10
- import "./key-BRl4AtNh.js";
11
- import "./http-DWJVfkyZ.js";
12
- import "./proof-wEvE3AbS.js";
13
- import "./types-YGkwBxol.js";
14
- import "./authdocloader-K0Peq1hX.js";
15
- import "./vocab-DQ4SEIWh.js";
16
-
17
- export { FederationImpl };