@fedify/fedify 1.6.1-dev.881 → 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 (69) hide show
  1. package/dist/{actor-BidJp8n0.js → actor-CwAL6Q82.js} +179 -179
  2. package/dist/{actor-BRIxlOTx.js → actor-DezwbbQX.js} +3 -3
  3. package/dist/{authdocloader-CG3GTtW2.js → authdocloader-C-_Lr-KH.js} +3 -3
  4. package/dist/{authdocloader-BRs7flug.js → authdocloader-Df1y1MKv.js} +3 -3
  5. package/dist/{builder-DtoRVfyu.js → builder-C8tsk_Xe.js} +3 -3
  6. package/dist/{client-CQ24CTCb.js → client-CwjvB-Dh.js} +1 -1
  7. package/dist/compat/transformers.test.js +17 -17
  8. package/dist/{context-Dub61h2m.js → context-DfToVZY6.js} +2 -2
  9. package/dist/{docloader-CjMOaZ0w.js → docloader-BFRgyDAa.js} +1 -2
  10. package/dist/{docloader-BzbamfL0.js → docloader-BXc5egq6.js} +1 -2
  11. package/dist/federation/builder.test.js +4 -4
  12. package/dist/federation/handler.test.js +19 -19
  13. package/dist/federation/inbox.test.js +3 -3
  14. package/dist/federation/keycache.test.js +3 -3
  15. package/dist/federation/middleware.test.js +18 -18
  16. package/dist/federation/mod.js +10 -10
  17. package/dist/federation/mq.test.js +1 -1
  18. package/dist/federation/send.test.js +9 -9
  19. package/dist/{http-B3Xedrzu.js → http-3CJyDlPz.js} +3 -3
  20. package/dist/{http-CV67UidJ.js → http-DC3mY9EG.js} +3 -3
  21. package/dist/{inbox-BoldQCGa.js → inbox-CCbuuUqY.js} +2 -2
  22. package/dist/{key-Dt894e0l.js → key-CD8i4ZB_.js} +2 -2
  23. package/dist/{key-zqk3iQJM.js → key-Ce8aGBE5.js} +5 -5
  24. package/dist/{key-D3Mc3n0F.js → key-D0WW7EHK.js} +3 -3
  25. package/dist/{key-DD4k9Ph4.js → key-Y8a6dgOq.js} +4 -4
  26. package/dist/{keycache-DXp-3NZn.js → keycache-BtADunPo.js} +1 -1
  27. package/dist/{keys-j3LZyq_M.js → keys-BIY57kjo.js} +1 -1
  28. package/dist/{ld-BJz01zAZ.js → ld-D4G5WL1G.js} +3 -3
  29. package/dist/{lookup-DTOPcLsZ.js → lookup-C8V37GPa.js} +1 -1
  30. package/dist/{lookup-dfyiwjbB.js → lookup-CQnVHXIh.js} +3 -3
  31. package/dist/{lookup-CNv4GGs7.js → lookup-Ds1_3qy2.js} +1 -1
  32. package/dist/middleware-DPuaf71I.js +17 -0
  33. package/dist/{middleware-BXqSM2dw.js → middleware-DRpRVwO7.js} +15 -15
  34. package/dist/{middleware-DB7wiPiW.js → middleware-Jvf6WsMN.js} +10 -10
  35. package/dist/middleware-XHndzOUD.js +33 -0
  36. package/dist/mod.js +10 -10
  37. package/dist/nodeinfo/client.test.js +15 -28
  38. package/dist/nodeinfo/handler.test.js +18 -18
  39. package/dist/nodeinfo/mod.js +2 -2
  40. package/dist/{owner-DPR9iegf.js → owner-Dyk0zd-q.js} +3 -3
  41. package/dist/{proof-CIdBQp8W.js → proof-B8Hm2M5c.js} +3 -3
  42. package/dist/{proof-DozAJu8u.js → proof-D-CWdNQx.js} +3 -3
  43. package/dist/runtime/authdocloader.test.js +8 -8
  44. package/dist/runtime/docloader.test.js +61 -58
  45. package/dist/runtime/key.test.js +5 -5
  46. package/dist/runtime/mod.js +6 -6
  47. package/dist/{send-ZuWTBaWD.js → send-CJXTH3ST.js} +2 -2
  48. package/dist/sig/http.test.js +44 -39
  49. package/dist/sig/key.test.js +6 -6
  50. package/dist/sig/ld.test.js +7 -7
  51. package/dist/sig/mod.js +6 -6
  52. package/dist/sig/owner.test.js +8 -8
  53. package/dist/sig/proof.test.js +7 -7
  54. package/dist/{types-BkYhmwmv.js → types-D3XNqpGz.js} +1 -1
  55. package/dist/vocab/actor.test.js +28 -17
  56. package/dist/vocab/lookup.test.js +4 -4
  57. package/dist/vocab/mod.js +4 -4
  58. package/dist/vocab/type.test.js +2 -2
  59. package/dist/vocab/vocab.test.js +3 -3
  60. package/dist/{vocab-CKuJcawO.js → vocab-CPrCb9BR.js} +3 -3
  61. package/dist/{vocab-D0LMe9FE.js → vocab-CaZSjoCB.js} +178 -178
  62. package/dist/webfinger/handler.test.js +18 -18
  63. package/dist/webfinger/lookup.test.js +33 -38
  64. package/dist/webfinger/mod.js +2 -2
  65. package/package.json +1 -2
  66. package/dist/hongminhee__deno-mock-fetch-Az7fJGtg.js +0 -188
  67. package/dist/middleware-HBJtiy_q.js +0 -17
  68. package/dist/middleware-ORyJDzKn.js +0 -33
  69. /package/dist/{denokv-iB_ggPGm.js → denokv-B_GFWjrl.js} +0 -0
@@ -0,0 +1,17 @@
1
+
2
+ import { Temporal } from "@js-temporal/polyfill";
3
+ import { URLPattern } from "urlpattern-polyfill";
4
+
5
+ import "./transformers-ghwJuzGY.js";
6
+ import "./docloader-BFRgyDAa.js";
7
+ import "./actor-CwAL6Q82.js";
8
+ import { ContextImpl, FederationImpl, InboxContextImpl, KvSpecDeterminer, createFederation } from "./middleware-Jvf6WsMN.js";
9
+ import "./lookup-C8V37GPa.js";
10
+ import "./key-CD8i4ZB_.js";
11
+ import "./http-DC3mY9EG.js";
12
+ import "./proof-D-CWdNQx.js";
13
+ import "./types-D3XNqpGz.js";
14
+ import "./authdocloader-Df1y1MKv.js";
15
+ import "./vocab-CPrCb9BR.js";
16
+
17
+ export { FederationImpl };
@@ -3,26 +3,26 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { deno_default, getDocumentLoader, kvCache } from "./docloader-BzbamfL0.js";
7
- import { getNodeInfo } from "./client-CQ24CTCb.js";
6
+ import { deno_default, getDocumentLoader, kvCache } from "./docloader-BXc5egq6.js";
7
+ import { getNodeInfo } from "./client-CwjvB-Dh.js";
8
8
  import { RouterError } from "./router-D_aVZZUc.js";
9
9
  import { nodeInfoToJson } from "./types-CqoqWDkp.js";
10
- import { Activity, CryptographicKey, Link, Multikey, Object as Object$1, OrderedCollection, OrderedCollectionPage } from "./vocab-D0LMe9FE.js";
11
- import { lookupWebFinger } from "./lookup-CNv4GGs7.js";
10
+ import { Activity, CryptographicKey, Link, Multikey, Object as Object$1, OrderedCollection, OrderedCollectionPage } from "./vocab-CaZSjoCB.js";
11
+ import { lookupWebFinger } from "./lookup-Ds1_3qy2.js";
12
12
  import { getTypeId } from "./type-D2s5lmbZ.js";
13
- import { exportJwk, importJwk, validateCryptoKey } from "./key-D3Mc3n0F.js";
14
- import { verifyRequest } from "./http-B3Xedrzu.js";
15
- import { getAuthenticatedDocumentLoader } from "./authdocloader-CG3GTtW2.js";
16
- import { detachSignature, hasSignature, signJsonLd, verifyJsonLd } from "./ld-BJz01zAZ.js";
17
- import { doesActorOwnKey, getKeyOwner } from "./owner-DPR9iegf.js";
18
- import { signObject, verifyObject } from "./proof-CIdBQp8W.js";
19
- import { lookupObject, traverseCollection } from "./lookup-dfyiwjbB.js";
20
- import { routeActivity } from "./inbox-BoldQCGa.js";
21
- import { FederationBuilderImpl } from "./builder-DtoRVfyu.js";
13
+ import { exportJwk, importJwk, validateCryptoKey } from "./key-D0WW7EHK.js";
14
+ import { verifyRequest } from "./http-3CJyDlPz.js";
15
+ import { getAuthenticatedDocumentLoader } from "./authdocloader-C-_Lr-KH.js";
16
+ import { detachSignature, hasSignature, signJsonLd, verifyJsonLd } from "./ld-D4G5WL1G.js";
17
+ import { doesActorOwnKey, getKeyOwner } from "./owner-Dyk0zd-q.js";
18
+ import { signObject, verifyObject } from "./proof-B8Hm2M5c.js";
19
+ import { lookupObject, traverseCollection } from "./lookup-CQnVHXIh.js";
20
+ import { routeActivity } from "./inbox-CCbuuUqY.js";
21
+ import { FederationBuilderImpl } from "./builder-C8tsk_Xe.js";
22
22
  import { buildCollectionSynchronizationHeader } from "./collection-Dfb0TPno.js";
23
- import { KvKeyCache } from "./keycache-DXp-3NZn.js";
23
+ import { KvKeyCache } from "./keycache-BtADunPo.js";
24
24
  import { createExponentialBackoffPolicy } from "./retry-BiIhZWgD.js";
25
- import { extractInboxes, sendActivity } from "./send-ZuWTBaWD.js";
25
+ import { extractInboxes, sendActivity } from "./send-CJXTH3ST.js";
26
26
  import { getLogger, withContext } from "@logtape/logtape";
27
27
  import { SpanKind, SpanStatusCode, context, propagation, trace } from "@opentelemetry/api";
28
28
  import { ATTR_HTTP_REQUEST_HEADER, ATTR_HTTP_REQUEST_METHOD, ATTR_HTTP_RESPONSE_HEADER, ATTR_HTTP_RESPONSE_STATUS_CODE, ATTR_URL_FULL } from "@opentelemetry/semantic-conventions";
@@ -3,15 +3,15 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
 
5
5
  import { getDefaultActivityTransformers } from "./transformers-ghwJuzGY.js";
6
- import { deno_default, getDocumentLoader, kvCache } from "./docloader-CjMOaZ0w.js";
7
- import { Activity, CryptographicKey, Link, Multikey, Object as Object$1, OrderedCollection, OrderedCollectionPage, getTypeId } from "./actor-BidJp8n0.js";
8
- import { lookupWebFinger } from "./lookup-DTOPcLsZ.js";
9
- import { exportJwk, importJwk, validateCryptoKey } from "./key-Dt894e0l.js";
10
- import { doubleKnock, verifyRequest } from "./http-CV67UidJ.js";
11
- import { detachSignature, doesActorOwnKey, getKeyOwner, hasSignature, signJsonLd, signObject, verifyJsonLd, verifyObject } from "./proof-DozAJu8u.js";
12
- import { getNodeInfo, nodeInfoToJson } from "./types-BkYhmwmv.js";
13
- import { getAuthenticatedDocumentLoader } from "./authdocloader-BRs7flug.js";
14
- import { lookupObject, traverseCollection } from "./vocab-CKuJcawO.js";
6
+ import { deno_default, getDocumentLoader, kvCache } from "./docloader-BFRgyDAa.js";
7
+ import { Activity, CryptographicKey, Link, Multikey, Object as Object$1, OrderedCollection, OrderedCollectionPage, getTypeId } from "./actor-CwAL6Q82.js";
8
+ import { lookupWebFinger } from "./lookup-C8V37GPa.js";
9
+ import { exportJwk, importJwk, validateCryptoKey } from "./key-CD8i4ZB_.js";
10
+ import { doubleKnock, verifyRequest } from "./http-DC3mY9EG.js";
11
+ import { detachSignature, doesActorOwnKey, getKeyOwner, hasSignature, signJsonLd, signObject, verifyJsonLd, verifyObject } from "./proof-D-CWdNQx.js";
12
+ import { getNodeInfo, nodeInfoToJson } from "./types-D3XNqpGz.js";
13
+ import { getAuthenticatedDocumentLoader } from "./authdocloader-Df1y1MKv.js";
14
+ import { lookupObject, traverseCollection } from "./vocab-CPrCb9BR.js";
15
15
  import { getLogger, withContext } from "@logtape/logtape";
16
16
  import { SpanKind, SpanStatusCode, context, propagation, trace } from "@opentelemetry/api";
17
17
  import { encodeHex } from "byte-encodings/hex";
@@ -312,7 +312,7 @@ var FederationBuilderImpl = class {
312
312
  this.objectTypeIds = {};
313
313
  }
314
314
  async build(options) {
315
- const { FederationImpl: FederationImpl$1 } = await import("./middleware-HBJtiy_q.js");
315
+ const { FederationImpl: FederationImpl$1 } = await import("./middleware-DPuaf71I.js");
316
316
  const f = new FederationImpl$1(options);
317
317
  const trailingSlashInsensitiveValue = f.router.trailingSlashInsensitive;
318
318
  f.router = this.router.clone();
@@ -0,0 +1,33 @@
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-DRpRVwO7.js";
7
+ import "./docloader-BXc5egq6.js";
8
+ import "./url-kTAI6_KP.js";
9
+ import "./semver-CbbIgUsa.js";
10
+ import "./client-CwjvB-Dh.js";
11
+ import "./router-D_aVZZUc.js";
12
+ import "./types-CqoqWDkp.js";
13
+ import "./multibase-DeCHcK8L.js";
14
+ import "./vocab-CaZSjoCB.js";
15
+ import "./langstr-DbWheeIS.js";
16
+ import "./lookup-Ds1_3qy2.js";
17
+ import "./type-D2s5lmbZ.js";
18
+ import "./actor-DezwbbQX.js";
19
+ import "./key-D0WW7EHK.js";
20
+ import "./http-3CJyDlPz.js";
21
+ import "./authdocloader-C-_Lr-KH.js";
22
+ import "./ld-D4G5WL1G.js";
23
+ import "./owner-Dyk0zd-q.js";
24
+ import "./proof-B8Hm2M5c.js";
25
+ import "./lookup-CQnVHXIh.js";
26
+ import "./inbox-CCbuuUqY.js";
27
+ import "./builder-C8tsk_Xe.js";
28
+ import "./collection-Dfb0TPno.js";
29
+ import "./keycache-BtADunPo.js";
30
+ import "./retry-BiIhZWgD.js";
31
+ import "./send-CJXTH3ST.js";
32
+
33
+ export { FederationImpl };
package/dist/mod.js CHANGED
@@ -4,17 +4,17 @@
4
4
 
5
5
  import { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers } from "./transformers-ghwJuzGY.js";
6
6
  import "./compat-Bb5myD13.js";
7
- import { FetchError, fetchDocumentLoader, getDocumentLoader, getUserAgent, kvCache } from "./docloader-CjMOaZ0w.js";
8
- 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, LanguageString, 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, exportMultibaseKey, exportSpki, getActorClassByTypeName, getActorHandle, getActorTypeName, getTypeId, importMultibaseKey, importPem, importPkcs1, importSpki, isActor, normalizeActorHandle } from "./actor-BidJp8n0.js";
9
- import { Router, RouterError, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, digest, respondWithObject, respondWithObjectIfAcceptable } from "./middleware-DB7wiPiW.js";
10
- import { lookupWebFinger } from "./lookup-DTOPcLsZ.js";
11
- import { exportJwk, fetchKey, generateCryptoKeyPair, importJwk } from "./key-Dt894e0l.js";
12
- import { signRequest, verifyRequest } from "./http-CV67UidJ.js";
13
- import { attachSignature, createProof, createSignature, detachSignature, doesActorOwnKey, getKeyOwner, signJsonLd, signObject, verifyJsonLd, verifyObject, verifyProof, verifySignature } from "./proof-DozAJu8u.js";
7
+ import { FetchError, fetchDocumentLoader, getDocumentLoader, getUserAgent, kvCache } from "./docloader-BFRgyDAa.js";
8
+ 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, LanguageString, 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, exportMultibaseKey, exportSpki, getActorClassByTypeName, getActorHandle, getActorTypeName, getTypeId, importMultibaseKey, importPem, importPkcs1, importSpki, isActor, normalizeActorHandle } from "./actor-CwAL6Q82.js";
9
+ import { Router, RouterError, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, digest, respondWithObject, respondWithObjectIfAcceptable } from "./middleware-Jvf6WsMN.js";
10
+ import { lookupWebFinger } from "./lookup-C8V37GPa.js";
11
+ import { exportJwk, fetchKey, generateCryptoKeyPair, importJwk } from "./key-CD8i4ZB_.js";
12
+ import { signRequest, verifyRequest } from "./http-DC3mY9EG.js";
13
+ import { attachSignature, createProof, createSignature, detachSignature, doesActorOwnKey, getKeyOwner, signJsonLd, signObject, verifyJsonLd, verifyObject, verifyProof, verifySignature } from "./proof-D-CWdNQx.js";
14
14
  import { InProcessMessageQueue, MemoryKvStore, ParallelMessageQueue } from "./federation-3B6BDKCK.js";
15
- import { formatSemVer, getNodeInfo, nodeInfoToJson, parseNodeInfo, parseSemVer } from "./types-BkYhmwmv.js";
16
- import { getAuthenticatedDocumentLoader } from "./authdocloader-BRs7flug.js";
17
- import { PUBLIC_COLLECTION, lookupObject, traverseCollection } from "./vocab-CKuJcawO.js";
15
+ import { formatSemVer, getNodeInfo, nodeInfoToJson, parseNodeInfo, parseSemVer } from "./types-D3XNqpGz.js";
16
+ import { getAuthenticatedDocumentLoader } from "./authdocloader-Df1y1MKv.js";
17
+ import { PUBLIC_COLLECTION, lookupObject, traverseCollection } from "./vocab-CPrCb9BR.js";
18
18
  import "./nodeinfo-CyEbLjHs.js";
19
19
  import "./runtime-BSkOVUWM.js";
20
20
  import "./sig-BXJO--F9.js";
@@ -6,28 +6,25 @@
6
6
  import { assertEquals } from "../assert_equals-Dnj7ejjL.js";
7
7
  import "../assert-YJk-1DlZ.js";
8
8
  import "../assert_instance_of-DBIoG5k7.js";
9
- import "../docloader-BzbamfL0.js";
9
+ import "../docloader-BXc5egq6.js";
10
10
  import "../url-kTAI6_KP.js";
11
11
  import "../semver-CbbIgUsa.js";
12
- import { getNodeInfo, parseInboundService, parseNodeInfo, parseOutboundService, parseProtocol, parseServices, parseSoftware, parseUsage } from "../client-CQ24CTCb.js";
12
+ import { getNodeInfo, parseInboundService, parseNodeInfo, parseOutboundService, parseProtocol, parseServices, parseSoftware, parseUsage } from "../client-CwjvB-Dh.js";
13
13
  import { test } from "../testing-jcGLO9Lp.js";
14
14
  import "../std__assert-CHXwj7zk.js";
15
15
  import "../assert_rejects-BZjUwo62.js";
16
16
  import "../assert_is_error-jyzqjHud.js";
17
17
  import "../assert_not_equals-wx-SRs4i.js";
18
18
  import "../assert_throws-gBPv3v2V.js";
19
- import { install, mock, uninstall } from "../hongminhee__deno-mock-fetch-Az7fJGtg.js";
19
+ import { esm_default } from "../esm-Btx3E8og.js";
20
20
 
21
21
  //#region nodeinfo/client.test.ts
22
22
  test("getNodeInfo()", async (t) => {
23
- install();
24
- mock("GET@/.well-known/nodeinfo", (req) => {
25
- assertEquals(new URL(req.url).host, "example.com");
26
- return new Response(JSON.stringify({ links: [{
27
- rel: "http://nodeinfo.diaspora.software/ns/schema/2.1",
28
- href: "https://example.com/nodeinfo/2.1"
29
- }] }));
30
- });
23
+ esm_default.spyGlobal();
24
+ esm_default.get("https://example.com/.well-known/nodeinfo", { body: { links: [{
25
+ rel: "http://nodeinfo.diaspora.software/ns/schema/2.1",
26
+ href: "https://example.com/nodeinfo/2.1"
27
+ }] } });
31
28
  const rawExpected = {
32
29
  software: {
33
30
  name: "foo",
@@ -40,14 +37,8 @@ test("getNodeInfo()", async (t) => {
40
37
  localComments: 456
41
38
  }
42
39
  };
43
- mock("GET@/nodeinfo/2.1", (req) => {
44
- assertEquals(new URL(req.url).host, "example.com");
45
- return new Response(JSON.stringify(rawExpected));
46
- });
47
- mock("GET@/404", (req) => {
48
- assertEquals(new URL(req.url).host, "example.com");
49
- return new Response(null, { status: 404 });
50
- });
40
+ esm_default.get("https://example.com/nodeinfo/2.1", { body: rawExpected });
41
+ esm_default.get("https://example.com/404", { status: 404 });
51
42
  const expected = {
52
43
  software: {
53
44
  name: "foo",
@@ -76,18 +67,14 @@ test("getNodeInfo()", async (t) => {
76
67
  const info = await getNodeInfo("https://example.com/nodeinfo/2.1", { direct: true });
77
68
  assertEquals(info, expected);
78
69
  });
79
- mock("GET@/.well-known/nodeinfo", (req) => {
80
- assertEquals(new URL(req.url).host, "example.com");
81
- return new Response(JSON.stringify({ links: [] }));
82
- });
70
+ esm_default.removeRoutes();
71
+ esm_default.get("https://example.com/.well-known/nodeinfo", { body: { links: [] } });
83
72
  await t.step("indirect: no links", async () => {
84
73
  const info = await getNodeInfo("https://example.com/");
85
74
  assertEquals(info, void 0);
86
75
  });
87
- mock("GET@/.well-known/nodeinfo", (req) => {
88
- assertEquals(new URL(req.url).host, "example.com");
89
- return new Response(null, { status: 404 });
90
- });
76
+ esm_default.removeRoutes();
77
+ esm_default.get("https://example.com/.well-known/nodeinfo", { status: 404 });
91
78
  await t.step("indirect: 404", async () => {
92
79
  const info = await getNodeInfo("https://example.com/");
93
80
  assertEquals(info, void 0);
@@ -98,7 +85,7 @@ test("getNodeInfo()", async (t) => {
98
85
  const info2 = await getNodeInfo("https://example.com/404", { direct: true });
99
86
  assertEquals(info2, void 0);
100
87
  });
101
- uninstall();
88
+ esm_default.hardReset();
102
89
  });
103
90
  test("parseNodeInfo()", () => {
104
91
  const input = {
@@ -7,32 +7,32 @@ import { assertEquals } from "../assert_equals-Dnj7ejjL.js";
7
7
  import "../assert-YJk-1DlZ.js";
8
8
  import "../assert_instance_of-DBIoG5k7.js";
9
9
  import { MemoryKvStore } from "../kv-DohFOP2C.js";
10
- import { createFederation, handleNodeInfo, handleNodeInfoJrd } from "../middleware-BXqSM2dw.js";
11
- import "../docloader-BzbamfL0.js";
10
+ import { createFederation, handleNodeInfo, handleNodeInfoJrd } from "../middleware-DRpRVwO7.js";
11
+ import "../docloader-BXc5egq6.js";
12
12
  import "../url-kTAI6_KP.js";
13
13
  import { parseSemVer } from "../semver-CbbIgUsa.js";
14
- import "../client-CQ24CTCb.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 "../vocab-D0LMe9FE.js";
18
+ import "../vocab-CaZSjoCB.js";
19
19
  import "../langstr-DbWheeIS.js";
20
- import "../lookup-CNv4GGs7.js";
20
+ import "../lookup-Ds1_3qy2.js";
21
21
  import "../type-D2s5lmbZ.js";
22
- import "../actor-BRIxlOTx.js";
23
- import "../key-D3Mc3n0F.js";
24
- import "../http-B3Xedrzu.js";
25
- import "../authdocloader-CG3GTtW2.js";
26
- import "../ld-BJz01zAZ.js";
27
- import "../owner-DPR9iegf.js";
28
- import "../proof-CIdBQp8W.js";
29
- import "../lookup-dfyiwjbB.js";
30
- import "../inbox-BoldQCGa.js";
31
- import "../builder-DtoRVfyu.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
32
  import "../collection-Dfb0TPno.js";
33
- import "../keycache-DXp-3NZn.js";
33
+ import "../keycache-BtADunPo.js";
34
34
  import "../retry-BiIhZWgD.js";
35
- import "../send-ZuWTBaWD.js";
35
+ import "../send-CJXTH3ST.js";
36
36
  import { test } from "../testing-jcGLO9Lp.js";
37
37
  import "../std__assert-CHXwj7zk.js";
38
38
  import "../assert_rejects-BZjUwo62.js";
@@ -40,7 +40,7 @@ import "../assert_is_error-jyzqjHud.js";
40
40
  import "../assert_not_equals-wx-SRs4i.js";
41
41
  import "../assert_throws-gBPv3v2V.js";
42
42
  import "../docloader-09nVWLAZ.js";
43
- import { createRequestContext } from "../context-Dub61h2m.js";
43
+ import { createRequestContext } from "../context-DfToVZY6.js";
44
44
 
45
45
  //#region nodeinfo/handler.test.ts
46
46
  test("handleNodeInfo()", async () => {
@@ -2,8 +2,8 @@
2
2
  import { Temporal } from "@js-temporal/polyfill";
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
 
5
- import "../docloader-CjMOaZ0w.js";
6
- import { formatSemVer, getNodeInfo, nodeInfoToJson, parseNodeInfo, parseSemVer } from "../types-BkYhmwmv.js";
5
+ import "../docloader-BFRgyDAa.js";
6
+ import { formatSemVer, getNodeInfo, nodeInfoToJson, parseNodeInfo, parseSemVer } from "../types-D3XNqpGz.js";
7
7
  import "../nodeinfo-CyEbLjHs.js";
8
8
 
9
9
  export { formatSemVer, getNodeInfo, nodeInfoToJson, parseNodeInfo, parseSemVer };
@@ -3,9 +3,9 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { getDocumentLoader } from "./docloader-BzbamfL0.js";
7
- import { CryptographicKey, Object as Object$1 } from "./vocab-D0LMe9FE.js";
8
- import { isActor } from "./actor-BRIxlOTx.js";
6
+ import { getDocumentLoader } from "./docloader-BXc5egq6.js";
7
+ import { CryptographicKey, Object as Object$1 } from "./vocab-CaZSjoCB.js";
8
+ import { isActor } from "./actor-DezwbbQX.js";
9
9
  import { trace } from "@opentelemetry/api";
10
10
 
11
11
  //#region sig/owner.ts
@@ -3,10 +3,10 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { deno_default } from "./docloader-BzbamfL0.js";
7
- import { Activity, DataIntegrityProof, Multikey } from "./vocab-D0LMe9FE.js";
6
+ import { deno_default } from "./docloader-BXc5egq6.js";
7
+ import { Activity, DataIntegrityProof, Multikey } from "./vocab-CaZSjoCB.js";
8
8
  import { getTypeId } from "./type-D2s5lmbZ.js";
9
- import { fetchKey, validateCryptoKey } from "./key-D3Mc3n0F.js";
9
+ import { fetchKey, validateCryptoKey } from "./key-D0WW7EHK.js";
10
10
  import { getLogger } from "@logtape/logtape";
11
11
  import { SpanStatusCode, trace } from "@opentelemetry/api";
12
12
  import { encodeHex } from "byte-encodings/hex";
@@ -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-CjMOaZ0w.js";
6
- import { Activity, CryptographicKey, DataIntegrityProof, Multikey, Object as Object$1, getTypeId, isActor } from "./actor-BidJp8n0.js";
7
- import { fetchKey, validateCryptoKey } from "./key-Dt894e0l.js";
5
+ import { deno_default, getDocumentLoader } from "./docloader-BFRgyDAa.js";
6
+ import { Activity, CryptographicKey, DataIntegrityProof, Multikey, Object as Object$1, getTypeId, isActor } from "./actor-CwAL6Q82.js";
7
+ import { fetchKey, validateCryptoKey } from "./key-CD8i4ZB_.js";
8
8
  import { getLogger } from "@logtape/logtape";
9
9
  import { SpanStatusCode, trace } from "@opentelemetry/api";
10
10
  import jsonld from "jsonld";
@@ -6,17 +6,17 @@
6
6
  import { assertEquals } from "../assert_equals-Dnj7ejjL.js";
7
7
  import "../assert-YJk-1DlZ.js";
8
8
  import "../assert_instance_of-DBIoG5k7.js";
9
- import "../docloader-BzbamfL0.js";
9
+ import "../docloader-BXc5egq6.js";
10
10
  import { UrlError } from "../url-kTAI6_KP.js";
11
11
  import "../multibase-DeCHcK8L.js";
12
- import "../vocab-D0LMe9FE.js";
12
+ import "../vocab-CaZSjoCB.js";
13
13
  import "../langstr-DbWheeIS.js";
14
- import "../lookup-CNv4GGs7.js";
14
+ import "../lookup-Ds1_3qy2.js";
15
15
  import "../type-D2s5lmbZ.js";
16
- import "../actor-BRIxlOTx.js";
17
- import "../key-D3Mc3n0F.js";
18
- import { verifyRequest } from "../http-B3Xedrzu.js";
19
- import { getAuthenticatedDocumentLoader } from "../authdocloader-CG3GTtW2.js";
16
+ import "../actor-DezwbbQX.js";
17
+ import "../key-D0WW7EHK.js";
18
+ import { verifyRequest } from "../http-3CJyDlPz.js";
19
+ import { getAuthenticatedDocumentLoader } from "../authdocloader-C-_Lr-KH.js";
20
20
  import { test } from "../testing-jcGLO9Lp.js";
21
21
  import "../std__assert-CHXwj7zk.js";
22
22
  import { assertRejects } from "../assert_rejects-BZjUwo62.js";
@@ -24,7 +24,7 @@ import "../assert_is_error-jyzqjHud.js";
24
24
  import "../assert_not_equals-wx-SRs4i.js";
25
25
  import "../assert_throws-gBPv3v2V.js";
26
26
  import { mockDocumentLoader } from "../docloader-09nVWLAZ.js";
27
- import { rsaPrivateKey2 } from "../keys-j3LZyq_M.js";
27
+ import { rsaPrivateKey2 } from "../keys-BIY57kjo.js";
28
28
  import { esm_default } from "../esm-Btx3E8og.js";
29
29
 
30
30
  //#region runtime/authdocloader.test.ts
@@ -7,7 +7,7 @@ import { assertEquals } from "../assert_equals-Dnj7ejjL.js";
7
7
  import "../assert-YJk-1DlZ.js";
8
8
  import "../assert_instance_of-DBIoG5k7.js";
9
9
  import { MemoryKvStore } from "../kv-DohFOP2C.js";
10
- import { FetchError, contexts_default, deno_default, getDocumentLoader, getUserAgent, kvCache } from "../docloader-BzbamfL0.js";
10
+ import { FetchError, contexts_default, deno_default, getDocumentLoader, getUserAgent, kvCache } from "../docloader-BXc5egq6.js";
11
11
  import { UrlError } from "../url-kTAI6_KP.js";
12
12
  import { test } from "../testing-jcGLO9Lp.js";
13
13
  import "../std__assert-CHXwj7zk.js";
@@ -16,7 +16,7 @@ import "../assert_is_error-jyzqjHud.js";
16
16
  import "../assert_not_equals-wx-SRs4i.js";
17
17
  import { assertThrows } from "../assert_throws-gBPv3v2V.js";
18
18
  import { mockDocumentLoader } from "../docloader-09nVWLAZ.js";
19
- import { install, mock, uninstall } from "../hongminhee__deno-mock-fetch-Az7fJGtg.js";
19
+ import { esm_default } from "../esm-Btx3E8og.js";
20
20
  import process from "node:process";
21
21
 
22
22
  //#region runtime/docloader.test.ts
@@ -31,13 +31,13 @@ test("new FetchError()", () => {
31
31
  });
32
32
  test("getDocumentLoader()", async (t) => {
33
33
  const fetchDocumentLoader = getDocumentLoader();
34
- install();
35
- mock("GET@/object", (_req) => new Response(JSON.stringify({
34
+ esm_default.spyGlobal();
35
+ esm_default.get("https://example.com/object", { body: {
36
36
  "@context": "https://www.w3.org/ns/activitystreams",
37
37
  id: "https://example.com/object",
38
38
  name: "Fetched object",
39
39
  type: "Object"
40
- }), { status: 200 }));
40
+ } });
41
41
  await t.step("ok", async () => {
42
42
  assertEquals(await fetchDocumentLoader("https://example.com/object"), {
43
43
  contextUrl: null,
@@ -50,43 +50,37 @@ test("getDocumentLoader()", async (t) => {
50
50
  }
51
51
  });
52
52
  });
53
- mock("GET@/link-ctx", (_req) => new Response(JSON.stringify({
54
- id: "https://example.com/link-ctx",
55
- name: "Fetched object",
56
- type: "Object"
57
- }), {
58
- status: 200,
53
+ esm_default.get("https://example.com/link-ctx", {
54
+ body: {
55
+ id: "https://example.com/link-ctx",
56
+ name: "Fetched object",
57
+ type: "Object"
58
+ },
59
59
  headers: {
60
60
  "Content-Type": "application/activity+json",
61
61
  Link: "<https://www.w3.org/ns/activitystreams>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\""
62
62
  }
63
- }));
64
- mock("GET@/link-obj", (_req) => new Response("", {
65
- status: 200,
66
- headers: {
67
- "Content-Type": "text/html; charset=utf-8",
68
- Link: "<https://example.com/object>; rel=\"alternate\"; type=\"application/activity+json\""
69
- }
70
- }));
71
- mock("GET@/link-obj-relative", (_req) => new Response("", {
72
- status: 200,
73
- headers: {
74
- "Content-Type": "text/html; charset=utf-8",
75
- Link: "</object>; rel=\"alternate\"; type=\"application/activity+json\""
76
- }
77
- }));
78
- mock("GET@/obj-w-wrong-link", (_req) => new Response(JSON.stringify({
79
- "@context": "https://www.w3.org/ns/activitystreams",
80
- id: "https://example.com/obj-w-wrong-link",
81
- name: "Fetched object",
82
- type: "Object"
83
- }), {
84
- status: 200,
63
+ });
64
+ esm_default.get("https://example.com/link-obj", { headers: {
65
+ "Content-Type": "text/html; charset=utf-8",
66
+ Link: "<https://example.com/object>; rel=\"alternate\"; type=\"application/activity+json\""
67
+ } });
68
+ esm_default.get("https://example.com/link-obj-relative", { headers: {
69
+ "Content-Type": "text/html; charset=utf-8",
70
+ Link: "</object>; rel=\"alternate\"; type=\"application/activity+json\""
71
+ } });
72
+ esm_default.get("https://example.com/obj-w-wrong-link", {
73
+ body: {
74
+ "@context": "https://www.w3.org/ns/activitystreams",
75
+ id: "https://example.com/obj-w-wrong-link",
76
+ name: "Fetched object",
77
+ type: "Object"
78
+ },
85
79
  headers: {
86
80
  "Content-Type": "text/html; charset=utf-8",
87
81
  Link: "<https://example.com/object>; rel=\"alternate\"; type=\"application/ld+json; profile=\"https://www.w3.org/ns/activitystreams\"\""
88
82
  }
89
- }));
83
+ });
90
84
  await t.step("Link header", async () => {
91
85
  assertEquals(await fetchDocumentLoader("https://example.com/link-ctx"), {
92
86
  contextUrl: "https://www.w3.org/ns/activitystreams",
@@ -141,7 +135,8 @@ test("getDocumentLoader()", async (t) => {
141
135
  }
142
136
  });
143
137
  });
144
- mock("GET@/html-link", (_req) => new Response(`<html>
138
+ esm_default.get("https://example.com/html-link", {
139
+ body: `<html>
145
140
  <head>
146
141
  <meta charset=utf-8>
147
142
  <link
@@ -149,10 +144,9 @@ test("getDocumentLoader()", async (t) => {
149
144
  type='application/activity+json'
150
145
  href="https://example.com/object">
151
146
  </head>
152
- </html>`, {
153
- status: 200,
147
+ </html>`,
154
148
  headers: { "Content-Type": "text/html; charset=utf-8" }
155
- }));
149
+ });
156
150
  await t.step("HTML <link>", async () => {
157
151
  assertEquals(await fetchDocumentLoader("https://example.com/html-link"), {
158
152
  contextUrl: null,
@@ -165,7 +159,8 @@ test("getDocumentLoader()", async (t) => {
165
159
  }
166
160
  });
167
161
  });
168
- mock("GET@/html-a", (_req) => new Response(`<html>
162
+ esm_default.get("https://example.com/html-a", {
163
+ body: `<html>
169
164
  <head>
170
165
  <meta charset=utf-8>
171
166
  </head>
@@ -175,10 +170,9 @@ test("getDocumentLoader()", async (t) => {
175
170
  type=application/activity+json
176
171
  href=https://example.com/object>test</a>
177
172
  </body>
178
- </html>`, {
179
- status: 200,
173
+ </html>`,
180
174
  headers: { "Content-Type": "text/html; charset=utf-8" }
181
- }));
175
+ });
182
176
  await t.step("HTML <a>", async () => {
183
177
  assertEquals(await fetchDocumentLoader("https://example.com/html-a"), {
184
178
  contextUrl: null,
@@ -191,15 +185,15 @@ test("getDocumentLoader()", async (t) => {
191
185
  }
192
186
  });
193
187
  });
194
- mock("GET@/wrong-content-type", (_req) => new Response(JSON.stringify({
195
- "@context": "https://www.w3.org/ns/activitystreams",
196
- id: "https://example.com/wrong-content-type",
197
- name: "Fetched object",
198
- type: "Object"
199
- }), {
200
- status: 200,
188
+ esm_default.get("https://example.com/wrong-content-type", {
189
+ body: {
190
+ "@context": "https://www.w3.org/ns/activitystreams",
191
+ id: "https://example.com/wrong-content-type",
192
+ name: "Fetched object",
193
+ type: "Object"
194
+ },
201
195
  headers: { "Content-Type": "text/html; charset=utf-8" }
202
- }));
196
+ });
203
197
  await t.step("Wrong Content-Type", async () => {
204
198
  assertEquals(await fetchDocumentLoader("https://example.com/wrong-content-type"), {
205
199
  contextUrl: null,
@@ -212,7 +206,7 @@ test("getDocumentLoader()", async (t) => {
212
206
  }
213
207
  });
214
208
  });
215
- mock("GET@/404", (_req) => new Response("", { status: 404 }));
209
+ esm_default.get("https://example.com/404", { status: 404 });
216
210
  await t.step("not ok", async () => {
217
211
  await assertRejects(() => fetchDocumentLoader("https://example.com/404"), FetchError, "HTTP 404: https://example.com/404");
218
212
  });
@@ -226,8 +220,12 @@ test("getDocumentLoader()", async (t) => {
226
220
  await t.step("deny non-HTTP/HTTPS", async () => {
227
221
  await assertRejects(() => fetchDocumentLoader("ftp://localhost"), UrlError);
228
222
  });
229
- mock("GET@/localhost-redirect", (_req) => Response.redirect("https://localhost/object", 302));
230
- mock("GET@/localhost-link", (_req) => new Response(`<html>
223
+ esm_default.get("https://example.com/localhost-redirect", {
224
+ status: 302,
225
+ headers: { Location: "https://localhost/object" }
226
+ });
227
+ esm_default.get("https://example.com/localhost-link", {
228
+ body: `<html>
231
229
  <head>
232
230
  <meta charset=utf-8>
233
231
  <link
@@ -235,10 +233,15 @@ test("getDocumentLoader()", async (t) => {
235
233
  type='application/activity+json'
236
234
  href="https://localhost/object">
237
235
  </head>
238
- </html>`, {
239
- status: 200,
236
+ </html>`,
240
237
  headers: { "Content-Type": "text/html; charset=utf-8" }
241
- }));
238
+ });
239
+ esm_default.get("https://localhost/object", { body: {
240
+ "@context": "https://www.w3.org/ns/activitystreams",
241
+ id: "https://localhost/object",
242
+ name: "Fetched object",
243
+ type: "Object"
244
+ } });
242
245
  await t.step("allowPrivateAddress: false", async () => {
243
246
  await assertRejects(() => fetchDocumentLoader("https://localhost/object"), UrlError);
244
247
  await assertRejects(() => fetchDocumentLoader("https://example.com/localhost-redirect"), UrlError);
@@ -251,7 +254,7 @@ test("getDocumentLoader()", async (t) => {
251
254
  documentUrl: "https://localhost/object",
252
255
  document: {
253
256
  "@context": "https://www.w3.org/ns/activitystreams",
254
- id: "https://example.com/object",
257
+ id: "https://localhost/object",
255
258
  name: "Fetched object",
256
259
  type: "Object"
257
260
  }
@@ -260,7 +263,7 @@ test("getDocumentLoader()", async (t) => {
260
263
  assertEquals(await fetchDocumentLoader2("https://example.com/localhost-redirect"), expected);
261
264
  assertEquals(await fetchDocumentLoader2("https://example.com/localhost-link"), expected);
262
265
  });
263
- uninstall();
266
+ esm_default.hardReset();
264
267
  });
265
268
  test("kvCache()", async (t) => {
266
269
  const kv = new MemoryKvStore();