@fedify/fedify 1.6.11 → 1.6.13

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 (182) hide show
  1. package/dist/{actor-tT_B0pDn.d.ts → actor-5yLVgYbM.d.ts} +3 -3
  2. package/dist/{actor-KrOvzFz1.js → actor-CcchiJa2.js} +6 -6
  3. package/dist/{actor-CxnKxfwH.js → actor-_hg-8_KF.js} +329 -465
  4. package/dist/{assert-LOEeCUK5.js → assert-C-mZuSQl.js} +2 -2
  5. package/dist/{assert_equals-B44MxcIj.js → assert_equals-Dy0MG_Zw.js} +16 -16
  6. package/dist/{assert_instance_of-XtuFevV_.js → assert_instance_of-lS0Jr2iu.js} +2 -2
  7. package/dist/{assert_is_error-BTlryvT0.js → assert_is_error-CIYFACrT.js} +2 -2
  8. package/dist/{assert_not_equals-C685gKx6.js → assert_not_equals-C1azCAB0.js} +3 -6
  9. package/dist/{assert_rejects-DWQ4jaf9.js → assert_rejects-Bkh5lA1a.js} +3 -3
  10. package/dist/{assert_throws-YetpVSc-.js → assert_throws-CmpfkWEM.js} +3 -3
  11. package/dist/{authdocloader-CsnXlm3V.js → authdocloader-1Ja0Him4.js} +7 -9
  12. package/dist/{authdocloader-DsULyH5D.js → authdocloader-D0Ds92Vk.js} +6 -8
  13. package/dist/{builder-BjJSVOvs.js → builder-MOXlzktX.js} +7 -7
  14. package/dist/{chunk-Cx8LTkjm.js → chunk-DvTpRkcT.js} +22 -15
  15. package/dist/{client-Cd552pKL.d.ts → client-BvbhJik1.d.ts} +2 -2
  16. package/dist/{client-BlntqhE9.js → client-C0yKnQtt.js} +3 -3
  17. package/dist/{collection-Dfb0TPno.js → collection-XNLQhehO.js} +2 -3
  18. package/dist/{mod-CgmTOt4z.d.ts → compat/mod-MHHm8HmK.d.ts} +3 -3
  19. package/dist/compat/mod.js +1 -2
  20. package/dist/compat/transformers.test.js +34 -38
  21. package/dist/{context-DRhhOsMk.d.ts → context-C0X9n1tC.d.ts} +10 -10
  22. package/dist/{context-CiyuTkCx.js → context-D7ltDKkC.js} +5 -5
  23. package/dist/{docloader-09nVWLAZ.js → docloader-BDSHZfTJ.js} +1 -1
  24. package/dist/{docloader-BYgIBZvh.js → docloader-C8QMM0lt.js} +32 -152
  25. package/dist/{docloader-DlUDOVSe.d.ts → docloader-DecYq5GI.d.ts} +2 -2
  26. package/dist/{docloader-DOrb0fRp.js → docloader-M1Np6SYc.js} +31 -151
  27. package/dist/{esm-DO9PrujO.js → esm-BRXvTSrx.js} +36 -22
  28. package/dist/federation/builder.test.js +20 -26
  29. package/dist/federation/collection.test.js +11 -16
  30. package/dist/federation/handler.test.js +41 -48
  31. package/dist/federation/inbox.test.js +11 -11
  32. package/dist/federation/keycache.test.js +12 -11
  33. package/dist/federation/kv.test.js +8 -10
  34. package/dist/federation/middleware.test.js +99 -120
  35. package/dist/federation/mod-CLkToKJa.d.ts +6 -0
  36. package/dist/federation/mod.js +195 -12
  37. package/dist/federation/mq.test.js +9 -14
  38. package/dist/federation/retry.test.js +5 -4
  39. package/dist/federation/router.test.js +9 -10
  40. package/dist/federation/send.test.js +23 -24
  41. package/dist/{http-LsE7i_Zq.js → http-BDLuDcCk.js} +17 -26
  42. package/dist/{http-Dc8RIaDE.js → http-BHjHzW-Y.js} +17 -26
  43. package/dist/{http-BkUCISGt.d.ts → http-ByqMVN52.d.ts} +3 -3
  44. package/dist/{inbox-BVwejjm8.js → inbox-FoFUUhTd.js} +5 -5
  45. package/dist/{key-BTcmhZp7.js → key-BABKdX0W.js} +5 -5
  46. package/dist/{key-Bg_PKGpe.js → key-Bj3ZyKd0.js} +4 -4
  47. package/dist/key-CragWqc4.js +16 -0
  48. package/dist/key-OMbKIYLU.js +10 -0
  49. package/dist/{keycache-BnCTs9sG.js → keycache-DONR-3XM.js} +2 -2
  50. package/dist/{keys-pbGG00jU.js → keys-KKGS1cpG.js} +2 -2
  51. package/dist/{kv-p8sC8PTT.d.ts → kv-CyvhW67T.d.ts} +1 -1
  52. package/dist/{kv-DohFOP2C.js → kv-DosGYGwV.js} +1 -1
  53. package/dist/{langstr-DbWheeIS.js → langstr-pFHBDU4y.js} +1 -1
  54. package/dist/{ld-n_kUCeXG.js → ld-DWSCvUJ-.js} +9 -12
  55. package/dist/{lookup-vJccIKCS.d.ts → lookup-BULfTwGb.d.ts} +2 -2
  56. package/dist/{lookup-Cutk-FXA.js → lookup-C2TcPqxv.js} +4 -4
  57. package/dist/{lookup-DrAS097Q.js → lookup-DIQCWtDD.js} +3 -3
  58. package/dist/{lookup-1pupHJbK.js → lookup-DZBZTzld.js} +6 -6
  59. package/dist/middleware-BdpSheEs.js +32 -0
  60. package/dist/{middleware-CMTirIyg.js → middleware-C9cbWvtY.js} +35 -39
  61. package/dist/middleware-CZQPvn1Y.js +17 -0
  62. package/dist/{middleware-kjrPMCqA.js → middleware-DRRaBIs3.js} +38 -43
  63. package/dist/{mod-j45KmAfR.d.ts → mod-C3OG1oK4.d.ts} +4 -4
  64. package/dist/{mod-DSPyncxx.d.ts → mod-CMpqcqIz.d.ts} +3 -3
  65. package/dist/mod-zMq7BLOW.d.ts +20 -0
  66. package/dist/mod.js +17 -17
  67. package/dist/{mq-nceTGCuc.d.ts → mq-CITHOe0n.d.ts} +1 -1
  68. package/dist/{multibase-CnLHszip.js → multibase-DBcKTV2a.js} +1 -1
  69. package/dist/nodeinfo/client.test.js +19 -28
  70. package/dist/nodeinfo/handler.test.js +37 -44
  71. package/dist/nodeinfo/mod-DY5OWSvB.d.ts +4 -0
  72. package/dist/nodeinfo/mod.js +2 -3
  73. package/dist/nodeinfo/semver.test.js +13 -21
  74. package/dist/nodeinfo/types.test.js +9 -11
  75. package/dist/{owner-CbRc94FP.d.ts → owner-BPGFI8Z3.d.ts} +4 -4
  76. package/dist/{owner-c-Zzpacz.js → owner-BSBuyxV4.js} +4 -4
  77. package/dist/{proof-BTx3Maj-.js → proof-B8LPOkvZ.js} +14 -19
  78. package/dist/{proof-CTOU2zFF.js → proof-CBHYxfh3.js} +11 -13
  79. package/dist/{retry-BiIhZWgD.js → retry-BQet39_l.js} +1 -1
  80. package/dist/{router-D_aVZZUc.js → router-BuDkN4RQ.js} +1 -1
  81. package/dist/runtime/authdocloader.test.js +22 -26
  82. package/dist/runtime/docloader.test.js +50 -46
  83. package/dist/runtime/key.test.js +31 -53
  84. package/dist/runtime/langstr.test.js +8 -10
  85. package/dist/{mod-BTHfUeLo.d.ts → runtime/mod-C4NyJ6RS.d.ts} +4 -3
  86. package/dist/runtime/mod.js +6 -7
  87. package/dist/runtime/multibase/multibase.test.js +12 -18
  88. package/dist/runtime/url.test.js +7 -6
  89. package/dist/{semver-BNrOOAs9.js → semver-D9d-VO-_.js} +7 -17
  90. package/dist/{send-SniNSIKd.js → send-Cah-Z3UO.js} +4 -4
  91. package/dist/sig/http.test.js +104 -168
  92. package/dist/sig/key.test.js +17 -20
  93. package/dist/sig/ld.test.js +28 -35
  94. package/dist/sig/mod-DM0ceGER.d.ts +6 -0
  95. package/dist/sig/mod.js +6 -7
  96. package/dist/sig/owner.test.js +24 -30
  97. package/dist/sig/proof.test.js +24 -29
  98. package/dist/{std__assert-o_r9vqm1.js → std__assert-BdP_WkD-.js} +7 -13
  99. package/dist/testing/docloader.test.js +9 -12
  100. package/dist/testing/mod.js +2 -1
  101. package/dist/{testing-DLyvtiiW.js → testing-qaAD4B0t.js} +2 -2
  102. package/dist/{transformers-ghwJuzGY.js → transformers-CFSWUhNi.js} +1 -1
  103. package/dist/{type-CFuiGLz9.js → type-DFsmi-p1.js} +1 -1
  104. package/dist/{types-DG1qZLU9.js → types-BXvx0wJm.js} +8 -18
  105. package/dist/{types-CJHS5pXl.js → types-CB_2uuCA.js} +2 -2
  106. package/dist/{url-C2xuoQD1.js → url-BdNvnK9P.js} +1 -1
  107. package/dist/vocab/actor.test.js +76 -128
  108. package/dist/vocab/lookup.test.js +19 -23
  109. package/dist/vocab/mod-CgB887se.d.ts +6 -0
  110. package/dist/vocab/mod.js +4 -4
  111. package/dist/vocab/type.test.js +10 -10
  112. package/dist/vocab/vocab.test.js +109 -105
  113. package/dist/{vocab-lzEJg2bH.js → vocab-B0flx0SI.js} +328 -464
  114. package/dist/{vocab-DSFLLLe6.d.ts → vocab-BQaYsnhp.d.ts} +2 -2
  115. package/dist/{vocab-oKloyO0F.js → vocab-BXeM76FR.js} +5 -5
  116. package/dist/webfinger/handler.test.js +40 -48
  117. package/dist/webfinger/lookup.test.js +12 -15
  118. package/dist/webfinger/mod-CE5bmzpH.d.ts +4 -0
  119. package/dist/webfinger/mod.js +2 -3
  120. package/dist/x/{cfworkers.d.ts → cfworkers-D_9uuXWs.d.ts} +2 -2
  121. package/dist/x/cfworkers.test.js +7 -9
  122. package/dist/x/{hono.d.ts → hono-TxxAGdy4.d.ts} +2 -11
  123. package/dist/x/{sveltekit.d.ts → sveltekit-KCF9gOdN.d.ts} +2 -11
  124. package/package.json +1 -1
  125. package/dist/compat/mod.d.ts +0 -15
  126. package/dist/compat-Bb5myD13.js +0 -4
  127. package/dist/federation/mod.d.ts +0 -15
  128. package/dist/federation-DyRlaC4X.js +0 -192
  129. package/dist/key-BP-Oky5H.js +0 -16
  130. package/dist/key-DxKqQgGm.js +0 -10
  131. package/dist/middleware-CDYmpOKW.js +0 -33
  132. package/dist/middleware-CXZvlTVn.js +0 -17
  133. package/dist/mod-1pDWKvUL.d.ts +0 -2
  134. package/dist/mod-GIh5OYxW.d.ts +0 -2
  135. package/dist/mod-g0xFzAP9.d.ts +0 -2
  136. package/dist/mod.d.ts +0 -20
  137. package/dist/nodeinfo/mod.d.ts +0 -7
  138. package/dist/nodeinfo-CyEbLjHs.js +0 -4
  139. package/dist/runtime/mod.d.ts +0 -8
  140. package/dist/runtime-BSkOVUWM.js +0 -4
  141. package/dist/sig/mod.d.ts +0 -10
  142. package/dist/sig-BXJO--F9.js +0 -4
  143. package/dist/vocab/mod.d.ts +0 -8
  144. package/dist/webfinger/mod.d.ts +0 -7
  145. package/dist/webfinger-C3GIyXIg.js +0 -4
  146. /package/dist/compat/{transformers.test.d.ts → transformers.test-DnJbd34u.d.ts} +0 -0
  147. /package/dist/{denokv-B_GFWjrl.js → denokv-XeyH3cFs.js} +0 -0
  148. /package/dist/federation/{builder.test.d.ts → builder.test-Bpt6NOZ6.d.ts} +0 -0
  149. /package/dist/federation/{collection.test.d.ts → collection.test-DKJ6JOZz.d.ts} +0 -0
  150. /package/dist/federation/{handler.test.d.ts → handler.test-BMT7uLC0.d.ts} +0 -0
  151. /package/dist/federation/{inbox.test.d.ts → inbox.test-Do6i02Qp.d.ts} +0 -0
  152. /package/dist/federation/{keycache.test.d.ts → keycache.test-BT83IPZY.d.ts} +0 -0
  153. /package/dist/federation/{kv.test.d.ts → kv.test-kFzzF2VN.d.ts} +0 -0
  154. /package/dist/federation/{middleware.test.d.ts → middleware.test-B1R4_e3-.d.ts} +0 -0
  155. /package/dist/federation/{mq.test.d.ts → mq.test-l79EQQOe.d.ts} +0 -0
  156. /package/dist/federation/{retry.test.d.ts → retry.test-BqS50VCX.d.ts} +0 -0
  157. /package/dist/federation/{router.test.d.ts → router.test-CYQl4po-.d.ts} +0 -0
  158. /package/dist/federation/{send.test.d.ts → send.test-COUnNUzv.d.ts} +0 -0
  159. /package/dist/nodeinfo/{client.test.d.ts → client.test-CZLe79hL.d.ts} +0 -0
  160. /package/dist/nodeinfo/{handler.test.d.ts → handler.test-B-EDZ_hK.d.ts} +0 -0
  161. /package/dist/nodeinfo/{semver.test.d.ts → semver.test-BEuuQSEM.d.ts} +0 -0
  162. /package/dist/nodeinfo/{types.test.d.ts → types.test-B5AT89WV.d.ts} +0 -0
  163. /package/dist/runtime/{authdocloader.test.d.ts → authdocloader.test-hCRKzn9v.d.ts} +0 -0
  164. /package/dist/runtime/{docloader.test.d.ts → docloader.test-CVd7i_5h.d.ts} +0 -0
  165. /package/dist/runtime/{key.test.d.ts → key.test-DBsILYSD.d.ts} +0 -0
  166. /package/dist/runtime/{langstr.test.d.ts → langstr.test-CiKxuuRY.d.ts} +0 -0
  167. /package/dist/runtime/multibase/{multibase.test.d.ts → multibase.test-Brh6gPBP.d.ts} +0 -0
  168. /package/dist/runtime/{url.test.d.ts → url.test-DlRqkU2j.d.ts} +0 -0
  169. /package/dist/sig/{http.test.d.ts → http.test-BpXNAWNI.d.ts} +0 -0
  170. /package/dist/sig/{key.test.d.ts → key.test-B2iLIugy.d.ts} +0 -0
  171. /package/dist/sig/{ld.test.d.ts → ld.test-D-cI70Gw.d.ts} +0 -0
  172. /package/dist/sig/{owner.test.d.ts → owner.test-B_YRjMPj.d.ts} +0 -0
  173. /package/dist/sig/{proof.test.d.ts → proof.test-BagEM_-4.d.ts} +0 -0
  174. /package/dist/testing/{docloader.test.d.ts → docloader.test-lrzf6sDZ.d.ts} +0 -0
  175. /package/dist/testing/{mod.d.ts → mod-3uM8ZvS7.d.ts} +0 -0
  176. /package/dist/vocab/{actor.test.d.ts → actor.test-ClC-iVWk.d.ts} +0 -0
  177. /package/dist/vocab/{lookup.test.d.ts → lookup.test-Cq1I-27w.d.ts} +0 -0
  178. /package/dist/vocab/{type.test.d.ts → type.test-bfFiYGcs.d.ts} +0 -0
  179. /package/dist/vocab/{vocab.test.d.ts → vocab.test-h-ZTisfu.d.ts} +0 -0
  180. /package/dist/webfinger/{handler.test.d.ts → handler.test-DiUeEDDD.d.ts} +0 -0
  181. /package/dist/webfinger/{lookup.test.d.ts → lookup.test-D9onm3U3.d.ts} +0 -0
  182. /package/dist/x/{cfworkers.test.d.ts → cfworkers.test-KXHlJ29z.d.ts} +0 -0
@@ -65,4 +65,4 @@ async function mockDocumentLoader(resource) {
65
65
  }
66
66
 
67
67
  //#endregion
68
- export { mockDocumentLoader };
68
+ export { mockDocumentLoader as t };
@@ -3,143 +3,14 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { UrlError, validatePublicUrl } from "./url-C2xuoQD1.js";
6
+ import { a as validatePublicUrl, t as UrlError } from "./url-BdNvnK9P.js";
7
7
  import { getLogger } from "@logtape/logtape";
8
8
  import { HTTPHeaderLink } from "@hugoalh/http-header-link";
9
9
  import process from "node:process";
10
10
 
11
11
  //#region deno.json
12
12
  var name = "@fedify/fedify";
13
- var version = "1.6.11";
14
- var license = "MIT";
15
- var exports = {
16
- ".": "./mod.ts",
17
- "./compat": "./compat/mod.ts",
18
- "./federation": "./federation/mod.ts",
19
- "./nodeinfo": "./nodeinfo/mod.ts",
20
- "./runtime": "./runtime/mod.ts",
21
- "./sig": "./sig/mod.ts",
22
- "./vocab": "./vocab/mod.ts",
23
- "./webfinger": "./webfinger/mod.ts",
24
- "./x/cfworkers": "./x/cfworkers.ts",
25
- "./x/denokv": "./x/denokv.ts",
26
- "./x/fresh": "./x/fresh.ts",
27
- "./x/hono": "./x/hono.ts",
28
- "./x/sveltekit": "./x/sveltekit.ts"
29
- };
30
- var imports = {
31
- "@cfworker/json-schema": "npm:@cfworker/json-schema@^4.1.1",
32
- "@cloudflare/workers-types": "npm:@cloudflare/workers-types@^4.20250529.0",
33
- "@es-toolkit/es-toolkit": "jsr:@es-toolkit/es-toolkit@^1.38.0",
34
- "@hugoalh/http-header-link": "jsr:@hugoalh/http-header-link@^1.0.2",
35
- "@multiformats/base-x": "npm:@multiformats/base-x@^4.0.1",
36
- "@opentelemetry/api": "npm:@opentelemetry/api@^1.9.0",
37
- "@opentelemetry/semantic-conventions": "npm:@opentelemetry/semantic-conventions@^1.27.0",
38
- "@phensley/language-tag": "npm:@phensley/language-tag@^1.9.0",
39
- "@std/assert": "jsr:@std/assert@^0.226.0",
40
- "@std/testing": "jsr:@std/testing@^0.224.0",
41
- "@std/url": "jsr:@std/url@^0.225.1",
42
- "@std/yaml": "jsr:@std/yaml@^0.224.3",
43
- "asn1js": "npm:asn1js@^3.0.5",
44
- "byte-encodings": "npm:byte-encodings@^1.0.11",
45
- "fast-check": "npm:fast-check@^3.22.0",
46
- "fetch-mock": "npm:fetch-mock@^12.5.2",
47
- "json-canon": "npm:json-canon@^1.0.1",
48
- "jsonld": "npm:jsonld@^8.3.2",
49
- "multicodec": "npm:multicodec@^3.2.1",
50
- "pkijs": "npm:pkijs@^3.2.4",
51
- "structured-field-values": "npm:structured-field-values@^2.0.4",
52
- "tsdown": "npm:tsdown@^0.12.2",
53
- "uri-template-router": "npm:uri-template-router@^0.0.17",
54
- "url-template": "npm:url-template@^3.1.1"
55
- };
56
- var include = ["vocab/vocab.ts"];
57
- var exclude = [
58
- ".test-report.xml",
59
- "apidoc/",
60
- "cfworkers/dist/",
61
- "cfworkers/fixtures/",
62
- "cfworkers/imports.ts",
63
- "cfworkers/README.md",
64
- "cfworkers/server.ts",
65
- "cfworkers/server.js",
66
- "cfworkers/server.js.map",
67
- "codegen/schema.yaml",
68
- "dist/",
69
- "node_modules/",
70
- "npm/",
71
- "pnpm-lock.yaml",
72
- "vocab/*.yaml",
73
- "!vocab/vocab.ts"
74
- ];
75
- var tasks = {
76
- "codegen": "deno run --allow-read --allow-write --check codegen/main.ts vocab/ ../runtime/ > vocab/vocab.ts && deno fmt vocab/vocab.ts && deno cache vocab/vocab.ts && deno check vocab/vocab.ts",
77
- "check-version": "deno run --allow-read=package.json scripts/check_version.ts && deno run ../cli/scripts/check_version.ts",
78
- "sync-version": "deno run --allow-read=package.json --allow-write=package.json scripts/sync_version.ts && deno run --allow-read=../cli/deno.json --allow-write=../cli/deno.json ../cli/scripts/sync_version.ts",
79
- "cache": {
80
- "command": "deno cache mod.ts",
81
- "dependencies": ["check-version", "codegen"]
82
- },
83
- "check": {
84
- "command": "deno fmt --check && deno lint && deno check */*.ts",
85
- "dependencies": ["codegen"]
86
- },
87
- "test": {
88
- "command": "deno test --check --doc --allow-read --allow-write --allow-env --unstable-kv --trace-leaks --parallel",
89
- "dependencies": ["codegen"]
90
- },
91
- "coverage": "deno task test --clean --coverage && deno coverage --html coverage",
92
- "bench": {
93
- "command": "deno bench --allow-read --allow-write --allow-net --allow-env --allow-run --unstable-kv",
94
- "dependencies": ["codegen"]
95
- },
96
- "apidoc": {
97
- "command": "deno doc --html --name=Fedify --output=apidoc/ mod.ts",
98
- "dependencies": ["codegen"]
99
- },
100
- "publish": {
101
- "command": "deno publish",
102
- "dependencies": ["check-version", "codegen"]
103
- },
104
- "pnpm:install": "pnpm install",
105
- "pnpm:build": {
106
- "command": "pnpm exec tsdown",
107
- "dependencies": ["codegen", "pnpm:install"]
108
- },
109
- "npm": {
110
- "command": "pnpm pack",
111
- "dependencies": ["sync-version", "pnpm:install"]
112
- },
113
- "test:node": {
114
- "command": "cd dist/ && node --test",
115
- "dependencies": ["pnpm:build"]
116
- },
117
- "test:bun": {
118
- "command": "cd dist/ && bun test --timeout 60000",
119
- "dependencies": ["pnpm:build"]
120
- },
121
- "test:cfworkers": {
122
- "command": "pnpm exec wrangler deploy --dry-run --outdir cfworkers && node --import=tsx cfworkers/client.ts",
123
- "dependencies": ["pnpm:build"]
124
- },
125
- "test-all": { "dependencies": [
126
- "check",
127
- "test",
128
- "test:node",
129
- "test:bun",
130
- "test:cfworkers"
131
- ] }
132
- };
133
- var deno_default = {
134
- name,
135
- version,
136
- license,
137
- exports,
138
- imports,
139
- include,
140
- exclude,
141
- tasks
142
- };
13
+ var version = "1.6.13";
143
14
 
144
15
  //#endregion
145
16
  //#region runtime/contexts.ts
@@ -4361,28 +4232,37 @@ async function getRemoteDocument(url, response, fetch$1) {
4361
4232
  }
4362
4233
  let document;
4363
4234
  if (!jsonLd && (contentType === "text/html" || contentType?.startsWith("text/html;") || contentType === "application/xhtml+xml" || contentType?.startsWith("application/xhtml+xml;"))) {
4364
- const p = /<(a|link)((\s+[a-z][a-z:_-]*=("[^"]*"|'[^']*'|[^\s>]+))+)\s*\/?>/gi;
4365
- const p2 = /\s+([a-z][a-z:_-]*)=("([^"]*)"|'([^']*)'|([^\s>]+))/gi;
4235
+ const MAX_HTML_SIZE = 1024 * 1024;
4366
4236
  const html = await response.text();
4367
- let m;
4368
- const rawAttribs = [];
4369
- while ((m = p.exec(html)) !== null) rawAttribs.push(m[2]);
4370
- for (const rawAttrs of rawAttribs) {
4371
- let m2;
4372
- const attribs = {};
4373
- while ((m2 = p2.exec(rawAttrs)) !== null) {
4374
- const key = m2[1].toLowerCase();
4375
- attribs[key] = m2[3] ?? m2[4] ?? m2[5] ?? "";
4376
- }
4377
- if (attribs.rel === "alternate" && "type" in attribs && (attribs.type === "application/activity+json" || attribs.type === "application/ld+json" || attribs.type.startsWith("application/ld+json;")) && "href" in attribs && new URL(attribs.href, docUrl).href !== docUrl.href) {
4378
- logger.debug("Found alternate document: {alternateUrl} from {url}", {
4379
- alternateUrl: attribs.href,
4380
- url: documentUrl
4381
- });
4382
- return await fetch$1(new URL(attribs.href, docUrl).href);
4237
+ if (html.length > MAX_HTML_SIZE) {
4238
+ logger.warn("HTML response too large, skipping alternate link discovery: {url}", {
4239
+ url: documentUrl,
4240
+ size: html.length
4241
+ });
4242
+ document = JSON.parse(html);
4243
+ } else {
4244
+ const tagPattern = /<(a|link)\s+([^>]*?)\s*\/?>/gi;
4245
+ const attrPattern = /([a-z][a-z:_-]*)=(?:"([^"]*)"|'([^']*)'|([^\s>]+))/gi;
4246
+ let tagMatch;
4247
+ while ((tagMatch = tagPattern.exec(html)) !== null) {
4248
+ const tagContent = tagMatch[2];
4249
+ let attrMatch;
4250
+ const attribs = {};
4251
+ attrPattern.lastIndex = 0;
4252
+ while ((attrMatch = attrPattern.exec(tagContent)) !== null) {
4253
+ const key = attrMatch[1].toLowerCase();
4254
+ attribs[key] = attrMatch[2] ?? attrMatch[3] ?? attrMatch[4] ?? "";
4255
+ }
4256
+ if (attribs.rel === "alternate" && "type" in attribs && (attribs.type === "application/activity+json" || attribs.type === "application/ld+json" || attribs.type.startsWith("application/ld+json;")) && "href" in attribs && new URL(attribs.href, docUrl).href !== docUrl.href) {
4257
+ logger.debug("Found alternate document: {alternateUrl} from {url}", {
4258
+ alternateUrl: attribs.href,
4259
+ url: documentUrl
4260
+ });
4261
+ return await fetch$1(new URL(attribs.href, docUrl).href);
4262
+ }
4383
4263
  }
4264
+ document = JSON.parse(html);
4384
4265
  }
4385
- document = JSON.parse(html);
4386
4266
  } else document = await response.json();
4387
4267
  logger.debug("Fetched document: {status} {url} {headers}", {
4388
4268
  status: response.status,
@@ -4521,7 +4401,7 @@ function kvCache({ loader, kv, prefix, rules }) {
4521
4401
  * @since 1.3.0
4522
4402
  */
4523
4403
  function getUserAgent({ software, url } = {}) {
4524
- const fedify = `Fedify/${deno_default.version}`;
4404
+ const fedify = `Fedify/${version}`;
4525
4405
  const runtime = globalThis.Deno?.version?.deno != null ? `Deno/${Deno.version.deno}` : globalThis.process?.versions?.bun != null ? `Bun/${process.versions.bun}` : "navigator" in globalThis && navigator.userAgent === "Cloudflare-Workers" ? navigator.userAgent : globalThis.process?.versions?.node != null ? `Node.js/${process.versions.node}` : null;
4526
4406
  const userAgent = software == null ? [fedify] : [software, fedify];
4527
4407
  if (runtime != null) userAgent.push(runtime);
@@ -4530,4 +4410,4 @@ function getUserAgent({ software, url } = {}) {
4530
4410
  }
4531
4411
 
4532
4412
  //#endregion
4533
- export { FetchError, contexts_default, createRequest, deno_default, fetchDocumentLoader, getDocumentLoader, getRemoteDocument, getUserAgent, kvCache, logRequest };
4413
+ export { getRemoteDocument as a, logRequest as c, version as d, getDocumentLoader as i, contexts_default as l, createRequest as n, getUserAgent as o, fetchDocumentLoader as r, kvCache as s, FetchError as t, name as u };
@@ -1,6 +1,6 @@
1
1
  import { Temporal } from "@js-temporal/polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
- import { KvKey, KvStore } from "./kv-p8sC8PTT.js";
3
+ import { n as KvStore, t as KvKey } from "./kv-CyvhW67T.js";
4
4
 
5
5
  //#region runtime/docloader.d.ts
6
6
  /**
@@ -205,4 +205,4 @@ declare function getUserAgent({
205
205
  url
206
206
  }?: GetUserAgentOptions): string;
207
207
  //#endregion
208
- export { AuthenticatedDocumentLoaderFactory, DocumentLoader, DocumentLoaderFactory, DocumentLoaderFactoryOptions, FetchError, GetDocumentLoaderOptions, GetUserAgentOptions, KvCacheParameters, RemoteDocument, fetchDocumentLoader, getDocumentLoader, getUserAgent, kvCache };
208
+ export { FetchError as a, KvCacheParameters as c, getDocumentLoader as d, getUserAgent as f, DocumentLoaderFactoryOptions as i, RemoteDocument as l, DocumentLoader as n, GetDocumentLoaderOptions as o, kvCache as p, DocumentLoaderFactory as r, GetUserAgentOptions as s, AuthenticatedDocumentLoaderFactory as t, fetchDocumentLoader as u };
@@ -10,136 +10,7 @@ import { isIP } from "node:net";
10
10
 
11
11
  //#region deno.json
12
12
  var name = "@fedify/fedify";
13
- var version = "1.6.11";
14
- var license = "MIT";
15
- var exports = {
16
- ".": "./mod.ts",
17
- "./compat": "./compat/mod.ts",
18
- "./federation": "./federation/mod.ts",
19
- "./nodeinfo": "./nodeinfo/mod.ts",
20
- "./runtime": "./runtime/mod.ts",
21
- "./sig": "./sig/mod.ts",
22
- "./vocab": "./vocab/mod.ts",
23
- "./webfinger": "./webfinger/mod.ts",
24
- "./x/cfworkers": "./x/cfworkers.ts",
25
- "./x/denokv": "./x/denokv.ts",
26
- "./x/fresh": "./x/fresh.ts",
27
- "./x/hono": "./x/hono.ts",
28
- "./x/sveltekit": "./x/sveltekit.ts"
29
- };
30
- var imports = {
31
- "@cfworker/json-schema": "npm:@cfworker/json-schema@^4.1.1",
32
- "@cloudflare/workers-types": "npm:@cloudflare/workers-types@^4.20250529.0",
33
- "@es-toolkit/es-toolkit": "jsr:@es-toolkit/es-toolkit@^1.38.0",
34
- "@hugoalh/http-header-link": "jsr:@hugoalh/http-header-link@^1.0.2",
35
- "@multiformats/base-x": "npm:@multiformats/base-x@^4.0.1",
36
- "@opentelemetry/api": "npm:@opentelemetry/api@^1.9.0",
37
- "@opentelemetry/semantic-conventions": "npm:@opentelemetry/semantic-conventions@^1.27.0",
38
- "@phensley/language-tag": "npm:@phensley/language-tag@^1.9.0",
39
- "@std/assert": "jsr:@std/assert@^0.226.0",
40
- "@std/testing": "jsr:@std/testing@^0.224.0",
41
- "@std/url": "jsr:@std/url@^0.225.1",
42
- "@std/yaml": "jsr:@std/yaml@^0.224.3",
43
- "asn1js": "npm:asn1js@^3.0.5",
44
- "byte-encodings": "npm:byte-encodings@^1.0.11",
45
- "fast-check": "npm:fast-check@^3.22.0",
46
- "fetch-mock": "npm:fetch-mock@^12.5.2",
47
- "json-canon": "npm:json-canon@^1.0.1",
48
- "jsonld": "npm:jsonld@^8.3.2",
49
- "multicodec": "npm:multicodec@^3.2.1",
50
- "pkijs": "npm:pkijs@^3.2.4",
51
- "structured-field-values": "npm:structured-field-values@^2.0.4",
52
- "tsdown": "npm:tsdown@^0.12.2",
53
- "uri-template-router": "npm:uri-template-router@^0.0.17",
54
- "url-template": "npm:url-template@^3.1.1"
55
- };
56
- var include = ["vocab/vocab.ts"];
57
- var exclude = [
58
- ".test-report.xml",
59
- "apidoc/",
60
- "cfworkers/dist/",
61
- "cfworkers/fixtures/",
62
- "cfworkers/imports.ts",
63
- "cfworkers/README.md",
64
- "cfworkers/server.ts",
65
- "cfworkers/server.js",
66
- "cfworkers/server.js.map",
67
- "codegen/schema.yaml",
68
- "dist/",
69
- "node_modules/",
70
- "npm/",
71
- "pnpm-lock.yaml",
72
- "vocab/*.yaml",
73
- "!vocab/vocab.ts"
74
- ];
75
- var tasks = {
76
- "codegen": "deno run --allow-read --allow-write --check codegen/main.ts vocab/ ../runtime/ > vocab/vocab.ts && deno fmt vocab/vocab.ts && deno cache vocab/vocab.ts && deno check vocab/vocab.ts",
77
- "check-version": "deno run --allow-read=package.json scripts/check_version.ts && deno run ../cli/scripts/check_version.ts",
78
- "sync-version": "deno run --allow-read=package.json --allow-write=package.json scripts/sync_version.ts && deno run --allow-read=../cli/deno.json --allow-write=../cli/deno.json ../cli/scripts/sync_version.ts",
79
- "cache": {
80
- "command": "deno cache mod.ts",
81
- "dependencies": ["check-version", "codegen"]
82
- },
83
- "check": {
84
- "command": "deno fmt --check && deno lint && deno check */*.ts",
85
- "dependencies": ["codegen"]
86
- },
87
- "test": {
88
- "command": "deno test --check --doc --allow-read --allow-write --allow-env --unstable-kv --trace-leaks --parallel",
89
- "dependencies": ["codegen"]
90
- },
91
- "coverage": "deno task test --clean --coverage && deno coverage --html coverage",
92
- "bench": {
93
- "command": "deno bench --allow-read --allow-write --allow-net --allow-env --allow-run --unstable-kv",
94
- "dependencies": ["codegen"]
95
- },
96
- "apidoc": {
97
- "command": "deno doc --html --name=Fedify --output=apidoc/ mod.ts",
98
- "dependencies": ["codegen"]
99
- },
100
- "publish": {
101
- "command": "deno publish",
102
- "dependencies": ["check-version", "codegen"]
103
- },
104
- "pnpm:install": "pnpm install",
105
- "pnpm:build": {
106
- "command": "pnpm exec tsdown",
107
- "dependencies": ["codegen", "pnpm:install"]
108
- },
109
- "npm": {
110
- "command": "pnpm pack",
111
- "dependencies": ["sync-version", "pnpm:install"]
112
- },
113
- "test:node": {
114
- "command": "cd dist/ && node --test",
115
- "dependencies": ["pnpm:build"]
116
- },
117
- "test:bun": {
118
- "command": "cd dist/ && bun test --timeout 60000",
119
- "dependencies": ["pnpm:build"]
120
- },
121
- "test:cfworkers": {
122
- "command": "pnpm exec wrangler deploy --dry-run --outdir cfworkers && node --import=tsx cfworkers/client.ts",
123
- "dependencies": ["pnpm:build"]
124
- },
125
- "test-all": { "dependencies": [
126
- "check",
127
- "test",
128
- "test:node",
129
- "test:bun",
130
- "test:cfworkers"
131
- ] }
132
- };
133
- var deno_default = {
134
- name,
135
- version,
136
- license,
137
- exports,
138
- imports,
139
- include,
140
- exclude,
141
- tasks
142
- };
13
+ var version = "1.6.13";
143
14
 
144
15
  //#endregion
145
16
  //#region runtime/contexts.ts
@@ -4418,28 +4289,37 @@ async function getRemoteDocument(url, response, fetch$1) {
4418
4289
  }
4419
4290
  let document;
4420
4291
  if (!jsonLd && (contentType === "text/html" || contentType?.startsWith("text/html;") || contentType === "application/xhtml+xml" || contentType?.startsWith("application/xhtml+xml;"))) {
4421
- const p = /<(a|link)((\s+[a-z][a-z:_-]*=("[^"]*"|'[^']*'|[^\s>]+))+)\s*\/?>/gi;
4422
- const p2 = /\s+([a-z][a-z:_-]*)=("([^"]*)"|'([^']*)'|([^\s>]+))/gi;
4292
+ const MAX_HTML_SIZE = 1024 * 1024;
4423
4293
  const html = await response.text();
4424
- let m;
4425
- const rawAttribs = [];
4426
- while ((m = p.exec(html)) !== null) rawAttribs.push(m[2]);
4427
- for (const rawAttrs of rawAttribs) {
4428
- let m2;
4429
- const attribs = {};
4430
- while ((m2 = p2.exec(rawAttrs)) !== null) {
4431
- const key = m2[1].toLowerCase();
4432
- attribs[key] = m2[3] ?? m2[4] ?? m2[5] ?? "";
4433
- }
4434
- if (attribs.rel === "alternate" && "type" in attribs && (attribs.type === "application/activity+json" || attribs.type === "application/ld+json" || attribs.type.startsWith("application/ld+json;")) && "href" in attribs && new URL(attribs.href, docUrl).href !== docUrl.href) {
4435
- logger.debug("Found alternate document: {alternateUrl} from {url}", {
4436
- alternateUrl: attribs.href,
4437
- url: documentUrl
4438
- });
4439
- return await fetch$1(new URL(attribs.href, docUrl).href);
4294
+ if (html.length > MAX_HTML_SIZE) {
4295
+ logger.warn("HTML response too large, skipping alternate link discovery: {url}", {
4296
+ url: documentUrl,
4297
+ size: html.length
4298
+ });
4299
+ document = JSON.parse(html);
4300
+ } else {
4301
+ const tagPattern = /<(a|link)\s+([^>]*?)\s*\/?>/gi;
4302
+ const attrPattern = /([a-z][a-z:_-]*)=(?:"([^"]*)"|'([^']*)'|([^\s>]+))/gi;
4303
+ let tagMatch;
4304
+ while ((tagMatch = tagPattern.exec(html)) !== null) {
4305
+ const tagContent = tagMatch[2];
4306
+ let attrMatch;
4307
+ const attribs = {};
4308
+ attrPattern.lastIndex = 0;
4309
+ while ((attrMatch = attrPattern.exec(tagContent)) !== null) {
4310
+ const key = attrMatch[1].toLowerCase();
4311
+ attribs[key] = attrMatch[2] ?? attrMatch[3] ?? attrMatch[4] ?? "";
4312
+ }
4313
+ if (attribs.rel === "alternate" && "type" in attribs && (attribs.type === "application/activity+json" || attribs.type === "application/ld+json" || attribs.type.startsWith("application/ld+json;")) && "href" in attribs && new URL(attribs.href, docUrl).href !== docUrl.href) {
4314
+ logger.debug("Found alternate document: {alternateUrl} from {url}", {
4315
+ alternateUrl: attribs.href,
4316
+ url: documentUrl
4317
+ });
4318
+ return await fetch$1(new URL(attribs.href, docUrl).href);
4319
+ }
4440
4320
  }
4321
+ document = JSON.parse(html);
4441
4322
  }
4442
- document = JSON.parse(html);
4443
4323
  } else document = await response.json();
4444
4324
  logger.debug("Fetched document: {status} {url} {headers}", {
4445
4325
  status: response.status,
@@ -4578,7 +4458,7 @@ function kvCache({ loader, kv, prefix, rules }) {
4578
4458
  * @since 1.3.0
4579
4459
  */
4580
4460
  function getUserAgent({ software, url } = {}) {
4581
- const fedify = `Fedify/${deno_default.version}`;
4461
+ const fedify = `Fedify/${version}`;
4582
4462
  const runtime = globalThis.Deno?.version?.deno != null ? `Deno/${Deno.version.deno}` : globalThis.process?.versions?.bun != null ? `Bun/${process.versions.bun}` : "navigator" in globalThis && navigator.userAgent === "Cloudflare-Workers" ? navigator.userAgent : globalThis.process?.versions?.node != null ? `Node.js/${process.versions.node}` : null;
4583
4463
  const userAgent = software == null ? [fedify] : [software, fedify];
4584
4464
  if (runtime != null) userAgent.push(runtime);
@@ -4587,4 +4467,4 @@ function getUserAgent({ software, url } = {}) {
4587
4467
  }
4588
4468
 
4589
4469
  //#endregion
4590
- export { FetchError, UrlError, createRequest, deno_default, fetchDocumentLoader, getDocumentLoader, getRemoteDocument, getUserAgent, kvCache, logRequest, validatePublicUrl };
4470
+ export { getRemoteDocument as a, logRequest as c, name as d, version as f, getDocumentLoader as i, UrlError as l, createRequest as n, getUserAgent as o, fetchDocumentLoader as r, kvCache as s, FetchError as t, validatePublicUrl as u };
@@ -3,10 +3,10 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { __commonJS, __toESM } from "./chunk-Cx8LTkjm.js";
6
+ import { i as __toESM, t as __commonJSMin } from "./chunk-DvTpRkcT.js";
7
7
 
8
8
  //#region node_modules/.pnpm/glob-to-regexp@0.4.1/node_modules/glob-to-regexp/index.js
9
- var require_glob_to_regexp = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/glob-to-regexp@0.4.1/node_modules/glob-to-regexp/index.js": ((exports, module) => {
9
+ var require_glob_to_regexp = /* @__PURE__ */ __commonJSMin(((exports, module) => {
10
10
  module.exports = function(glob$1, opts) {
11
11
  if (typeof glob$1 !== "string") throw new TypeError("Expected a string");
12
12
  var str = String(glob$1);
@@ -77,7 +77,7 @@ var require_glob_to_regexp = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/gl
77
77
  if (!flags || !~flags.indexOf("g")) reStr = "^" + reStr + "$";
78
78
  return new RegExp(reStr, flags);
79
79
  };
80
- }) });
80
+ }));
81
81
 
82
82
  //#endregion
83
83
  //#region node_modules/.pnpm/regexparam@3.0.0/node_modules/regexparam/dist/index.mjs
@@ -112,7 +112,7 @@ function parse(input, loose) {
112
112
  }
113
113
 
114
114
  //#endregion
115
- //#region node_modules/.pnpm/fetch-mock@12.5.4/node_modules/fetch-mock/dist/esm/TypeDescriptor.js
115
+ //#region node_modules/.pnpm/fetch-mock@12.6.0/node_modules/fetch-mock/dist/esm/TypeDescriptor.js
116
116
  const valueTypes = new Set([
117
117
  "boolean",
118
118
  "number",
@@ -204,7 +204,7 @@ var TypeDescriptor = class TypeDescriptor {
204
204
  };
205
205
 
206
206
  //#endregion
207
- //#region node_modules/.pnpm/fetch-mock@12.5.4/node_modules/fetch-mock/dist/esm/IsSubsetOf.js
207
+ //#region node_modules/.pnpm/fetch-mock@12.6.0/node_modules/fetch-mock/dist/esm/IsSubsetOf.js
208
208
  const allowedTypes = new Set([
209
209
  "array",
210
210
  "object",
@@ -358,7 +358,7 @@ function dequal(foo, bar) {
358
358
  }
359
359
 
360
360
  //#endregion
361
- //#region node_modules/.pnpm/fetch-mock@12.5.4/node_modules/fetch-mock/dist/esm/RequestUtils.js
361
+ //#region node_modules/.pnpm/fetch-mock@12.6.0/node_modules/fetch-mock/dist/esm/RequestUtils.js
362
362
  const absoluteUrlRX = new RegExp("^[a-z]+://|^data:", "i");
363
363
  const protocolRelativeUrlRX = new RegExp("^//", "i");
364
364
  function hasCredentialsInUrl(url) {
@@ -421,6 +421,11 @@ async function createCallLogFromRequest(request, options) {
421
421
  function getPath(url) {
422
422
  return (absoluteUrlRX.test(url) ? new URL(url) : new URL(url, "http://dummy")).pathname;
423
423
  }
424
+ function getHost(url) {
425
+ if (absoluteUrlRX.test(url)) return new URL(url).host;
426
+ else if ("location" in globalThis) return globalThis.location.host;
427
+ return null;
428
+ }
424
429
  function getQuery(url) {
425
430
  const u = absoluteUrlRX.test(url) ? new URL(url) : new URL(url, "http://dummy");
426
431
  return u.search ? u.search.substr(1) : "";
@@ -434,7 +439,7 @@ function normalizeHeaders(headers) {
434
439
  }
435
440
 
436
441
  //#endregion
437
- //#region node_modules/.pnpm/fetch-mock@12.5.4/node_modules/fetch-mock/dist/esm/Matchers.js
442
+ //#region node_modules/.pnpm/fetch-mock@12.6.0/node_modules/fetch-mock/dist/esm/Matchers.js
438
443
  var import_glob_to_regexp = /* @__PURE__ */ __toESM(require_glob_to_regexp(), 1);
439
444
  const isUrlMatcher = (matcher) => matcher instanceof RegExp || typeof matcher === "string" || typeof matcher === "object" && "href" in matcher;
440
445
  const isFunctionMatcher = (matcher) => typeof matcher === "function";
@@ -465,6 +470,9 @@ const stringMatchers = {
465
470
  const path = getPath(url);
466
471
  return path === targetString || path === dotlessTargetString;
467
472
  };
473
+ },
474
+ host: (targetString) => {
475
+ return ({ url }) => targetString === getHost(url);
468
476
  }
469
477
  };
470
478
  const getHeaderMatcher = ({ headers: expectedHeaders }) => {
@@ -486,8 +494,7 @@ const getMissingHeaderMatcher = ({ missingHeaders: expectedMissingHeaders }) =>
486
494
  const getMethodMatcher = ({ method: expectedMethod }) => {
487
495
  if (!expectedMethod) return;
488
496
  return ({ options: { method } = {} }) => {
489
- const actualMethod = method ? method.toLowerCase() : "get";
490
- return expectedMethod === actualMethod;
497
+ return expectedMethod === (method ? method.toLowerCase() : "get");
491
498
  };
492
499
  };
493
500
  const getQueryParamsMatcher = ({ query: passedQuery }) => {
@@ -617,7 +624,7 @@ const builtInMatchers = [
617
624
  ];
618
625
 
619
626
  //#endregion
620
- //#region node_modules/.pnpm/fetch-mock@12.5.4/node_modules/fetch-mock/dist/esm/StatusTextMap.js
627
+ //#region node_modules/.pnpm/fetch-mock@12.6.0/node_modules/fetch-mock/dist/esm/StatusTextMap.js
621
628
  const statusTextMap = {
622
629
  100: "Continue",
623
630
  101: "Switching Protocols",
@@ -685,7 +692,7 @@ const statusTextMap = {
685
692
  var StatusTextMap_default = statusTextMap;
686
693
 
687
694
  //#endregion
688
- //#region node_modules/.pnpm/fetch-mock@12.5.4/node_modules/fetch-mock/dist/esm/Route.js
695
+ //#region node_modules/.pnpm/fetch-mock@12.6.0/node_modules/fetch-mock/dist/esm/Route.js
689
696
  var __classPrivateFieldSet = void 0 && (void 0).__classPrivateFieldSet || function(receiver, state, value, kind, f) {
690
697
  if (kind === "m") throw new TypeError("Private method is not writable");
691
698
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
@@ -817,7 +824,7 @@ builtInMatchers.forEach(Route.defineMatcher);
817
824
  var Route_default = Route;
818
825
 
819
826
  //#endregion
820
- //#region node_modules/.pnpm/fetch-mock@12.5.4/node_modules/fetch-mock/dist/esm/Router.js
827
+ //#region node_modules/.pnpm/fetch-mock@12.6.0/node_modules/fetch-mock/dist/esm/Router.js
821
828
  const responseConfigProps = [
822
829
  "body",
823
830
  "headers",
@@ -869,18 +876,23 @@ var Router = class {
869
876
  throwSpecExceptions(callLog);
870
877
  return new Promise(async (resolve, reject) => {
871
878
  const { url, options, request, pendingPromises } = callLog;
879
+ let eventListenerAbortController;
872
880
  if (callLog.signal) {
873
881
  const abort = () => {
874
882
  const error = new DOMException("The operation was aborted.", "AbortError");
875
883
  const requestBody = request?.body || options?.body;
876
- if (requestBody instanceof ReadableStream) if (requestBody.locked) requestBody.getReader().cancel(error);
884
+ if (requestBody instanceof ReadableStream) if (requestBody.locked) console.warn("fetch-mock: Locked request body can't be cancelled");
877
885
  else requestBody.cancel(error);
878
- if (callLog?.response?.body) if (callLog.response.body.locked) callLog.response.body.getReader().cancel(error);
886
+ if (callLog?.response?.body) if (callLog.response.body.locked) console.warn("fetch-mock: Locked response body can't be cancelled");
879
887
  else callLog.response.body.cancel(error);
880
888
  reject(error);
881
889
  };
882
890
  if (callLog.signal.aborted) abort();
883
- callLog.signal.addEventListener("abort", abort);
891
+ eventListenerAbortController = new AbortController();
892
+ callLog.signal.addEventListener("abort", abort, {
893
+ once: true,
894
+ signal: eventListenerAbortController.signal
895
+ });
884
896
  }
885
897
  if (this.needsToReadBody(request)) options.body = await options.body;
886
898
  const route = (this.fallbackRoute ? [...this.routes, this.fallbackRoute] : this.routes).find((route$1) => route$1.matcher(callLog));
@@ -892,6 +904,8 @@ var Router = class {
892
904
  resolve(observableResponse);
893
905
  } catch (err) {
894
906
  reject(err);
907
+ } finally {
908
+ eventListenerAbortController?.abort();
895
909
  }
896
910
  else reject(/* @__PURE__ */ new Error(`fetch-mock: No response or fallback rule to cover ${options && options.method || "GET"} to ${url}`));
897
911
  });
@@ -989,7 +1003,7 @@ var Router = class {
989
1003
  };
990
1004
 
991
1005
  //#endregion
992
- //#region node_modules/.pnpm/fetch-mock@12.5.4/node_modules/fetch-mock/dist/esm/CallHistory.js
1006
+ //#region node_modules/.pnpm/fetch-mock@12.6.0/node_modules/fetch-mock/dist/esm/CallHistory.js
993
1007
  const isName = (filter) => typeof filter === "string" && /^[\da-zA-Z-]+$/.test(filter) && !["matched", "unmatched"].includes(filter);
994
1008
  const isMatchedOrUnmatched = (filter) => typeof filter === "boolean" || ["matched", "unmatched"].includes(filter);
995
1009
  var CallHistory = class {
@@ -1019,11 +1033,11 @@ var CallHistory = class {
1019
1033
  let calls = [...this.callLogs];
1020
1034
  if (typeof filter === "undefined" && !options) return calls;
1021
1035
  if (isMatchedOrUnmatched(filter)) {
1022
- if ([true, "matched"].includes(filter)) calls = calls.filter(({ route }) => !route.config.isFallback);
1023
- else if ([false, "unmatched"].includes(filter)) calls = calls.filter(({ route }) => Boolean(route.config.isFallback));
1036
+ if ([true, "matched"].includes(filter)) calls = calls.filter(({ route }) => !route?.config || !route.config.isFallback);
1037
+ else if ([false, "unmatched"].includes(filter)) calls = calls.filter(({ route }) => Boolean(route?.config && route.config.isFallback));
1024
1038
  if (!options) return calls;
1025
1039
  } else if (isName(filter)) {
1026
- calls = calls.filter(({ route: { config: { name } } }) => name === filter);
1040
+ calls = calls.filter(({ route }) => route?.config?.name === filter);
1027
1041
  if (!options) return calls;
1028
1042
  } else if (isUrlMatcher(filter)) options = {
1029
1043
  url: filter,
@@ -1074,7 +1088,7 @@ var CallHistory = class {
1074
1088
  var CallHistory_default = CallHistory;
1075
1089
 
1076
1090
  //#endregion
1077
- //#region node_modules/.pnpm/fetch-mock@12.5.4/node_modules/fetch-mock/dist/esm/FetchMock.js
1091
+ //#region node_modules/.pnpm/fetch-mock@12.6.0/node_modules/fetch-mock/dist/esm/FetchMock.js
1078
1092
  const defaultFetchMockConfig = {
1079
1093
  includeContentLength: true,
1080
1094
  matchPartialBody: false,
@@ -1207,8 +1221,8 @@ const fetchMock = new FetchMock({ ...defaultFetchMockConfig });
1207
1221
  var FetchMock_default = fetchMock;
1208
1222
 
1209
1223
  //#endregion
1210
- //#region node_modules/.pnpm/fetch-mock@12.5.4/node_modules/fetch-mock/dist/esm/index.js
1224
+ //#region node_modules/.pnpm/fetch-mock@12.6.0/node_modules/fetch-mock/dist/esm/index.js
1211
1225
  var esm_default = FetchMock_default;
1212
1226
 
1213
1227
  //#endregion
1214
- export { esm_default };
1228
+ export { esm_default as t };