@fedify/fedify 2.0.0-dev.1485 → 2.0.0-dev.149

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 (311) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +38 -18
  3. package/dist/actor-CCAL5-E_.cjs +42079 -0
  4. package/dist/{actor-7ivEf1H3.js → actor-DYdPViDz.js} +4 -1
  5. package/dist/{actor-C22bXuuC.d.ts → actor-DqFajh9s.d.ts} +2 -2
  6. package/dist/{actor-DXTdNCfp.js → actor-U_BZZ2ps.js} +7058 -2722
  7. package/dist/actor-f2NtjyCg.d.cts +128 -0
  8. package/dist/{assert-MZs1qjMx.js → assert-Dp5_aoAs.js} +1 -1
  9. package/dist/{assert_instance_of-DHz7EHNU.js → assert_instance_of-D1m8F7x0.js} +1 -1
  10. package/dist/{assert_not_equals-f3m3epl3.js → assert_not_equals-B2R_8p36.js} +1 -1
  11. package/dist/{assert_rejects-DiIiJbZn.js → assert_rejects-BoKYY0g1.js} +2 -2
  12. package/dist/{assert_is_error-BPGph1Jx.js → assert_throws-DjkXin1a.js} +32 -2
  13. package/dist/{builder-BPGqEvtB.js → builder-CYR2yKqn.js} +20 -8
  14. package/dist/chunk-DqRYRqnO.cjs +34 -0
  15. package/dist/chunk-HsBuZ-b2.js +41 -0
  16. package/dist/client-94iWEfQa.d.cts +222 -0
  17. package/dist/{client-DF8anIB5.d.ts → client-BsGzbnV-.d.ts} +3 -75
  18. package/dist/{client-g2FDBoeY.js → client-CD87uCL_.js} +4 -23
  19. package/dist/compat/mod.cjs +10 -0
  20. package/dist/compat/mod.d.cts +11 -0
  21. package/dist/compat/mod.d.ts +10 -12
  22. package/dist/compat/mod.js +5 -5
  23. package/dist/compat/transformers.test.js +29 -24
  24. package/dist/compat-DmDDELst.cjs +4 -0
  25. package/dist/compat-nxUqe4Z-.js +4 -0
  26. package/dist/context-DBQ7nMCw.d.cts +2449 -0
  27. package/dist/context-DH7LHJdw.js +109 -0
  28. package/dist/{context-DmlbRh9p.d.ts → context-mM0Nu5yo.d.ts} +335 -134
  29. package/dist/deno-BTeveqhY.js +131 -0
  30. package/dist/{testing-BG_8Fyas.js → dist-lStjlyET.js} +73 -114
  31. package/dist/{authdocloader-D_IvQE4z.js → docloader-BSGGKhrl.js} +17 -8
  32. package/dist/{esm-CPZhxxGc.js → esm-B52TuumP.js} +32 -17
  33. package/dist/federation/builder.test.js +16 -16
  34. package/dist/federation/collection.test.js +9 -12
  35. package/dist/federation/handler.test.js +123 -152
  36. package/dist/federation/idempotency.test.js +206 -0
  37. package/dist/federation/inbox.test.js +7 -7
  38. package/dist/federation/keycache.test.js +7 -8
  39. package/dist/federation/kv.test.js +64 -12
  40. package/dist/federation/middleware.test.js +281 -99
  41. package/dist/federation/mod.cjs +27 -0
  42. package/dist/federation/mod.d.cts +11 -0
  43. package/dist/federation/mod.d.ts +11 -13
  44. package/dist/federation/mod.js +13 -15
  45. package/dist/federation/mq.test.js +12 -13
  46. package/dist/federation/negotiation.test.js +25 -0
  47. package/dist/federation/retry.test.js +4 -6
  48. package/dist/federation/router.test.js +9 -11
  49. package/dist/federation/send.test.js +61 -18
  50. package/dist/federation-CoW-KDKv.cjs +266 -0
  51. package/dist/{federation-CMX7WzeL.js → federation-D0hkM4T7.js} +25 -3
  52. package/dist/{http-C7rxW7Kh.js → http-BIDOYI9f.js} +4 -3
  53. package/dist/{http-zsOxPKCt.js → http-BQRnmfXP.js} +260 -10
  54. package/dist/{http-DqSNLFNY.d.ts → http-BbO0ejuk.d.ts} +2 -2
  55. package/dist/http-DtYHWbwa.cjs +1106 -0
  56. package/dist/http-M8k5mKc0.d.cts +253 -0
  57. package/dist/{inbox-eK2W2MF3.js → inbox-DNjplQSR.js} +26 -7
  58. package/dist/{key-CYOcZ9G5.js → key-dws2_YsP.js} +4 -2
  59. package/dist/{keycache-BLq6GT4_.js → keycache-BbbXRjc-.js} +1 -1
  60. package/dist/{keys-BIwlbtMN.js → keys-C6QyjjIN.js} +2 -1
  61. package/dist/{kv-C7sopW2E.d.ts → kv-BpJND1Hr.d.ts} +30 -1
  62. package/dist/{kv-CRZrzyXm.js → kv-DaWUKuhD.js} +22 -0
  63. package/dist/kv-cD_d4hg-.d.cts +110 -0
  64. package/dist/kv-cache-1_lcnUMp.cjs +134 -0
  65. package/dist/kv-cache-BEP4OyiZ.js +122 -0
  66. package/dist/kv-cache-C6NrTtII.js +107 -0
  67. package/dist/{ld-DWwLYT4e.js → ld-C6UrncJk.js} +7 -4
  68. package/dist/lookup-BORWbouU.cjs +268 -0
  69. package/dist/lookup-BV72lfsA.js +256 -0
  70. package/dist/{lookup-DNQyH8UQ.js → lookup-BoiLMtAx.js} +33 -125
  71. package/dist/{lookup-BHYMosdS.js → lookup-yv_aH7K7.js} +3 -1
  72. package/dist/{middleware-BcVqlHyD.js → middleware--1K3DAB8.js} +143 -136
  73. package/dist/middleware-7Yg2p_nl.js +31 -0
  74. package/dist/{middleware-DakCaqXu.js → middleware-8Oymc6Na.js} +105 -188
  75. package/dist/middleware-C6YBw2qx.cjs +15 -0
  76. package/dist/middleware-D6XNERu3.js +15 -0
  77. package/dist/middleware-DBHDivdC.cjs +4237 -0
  78. package/dist/mod-B-hUPT2N.d.cts +1 -0
  79. package/dist/{mod-Cxt4Kpf6.d.ts → mod-BlVovdcy.d.ts} +20 -2
  80. package/dist/mod-BxRCHTz-.d.cts +307 -0
  81. package/dist/mod-C58MZ7Wx.d.cts +113 -0
  82. package/dist/mod-CAdoBu0x.d.ts +109 -0
  83. package/dist/mod-CcDPcLJW.d.cts +1 -0
  84. package/dist/{mod-Drmz72EK.d.ts → mod-D5Z2tISD.d.ts} +3 -3
  85. package/dist/mod-DgxG-byT.d.cts +266 -0
  86. package/dist/{lookup-3czM5mmU.d.ts → mod-Ds0mpFZU.d.ts} +9 -2
  87. package/dist/mod-Dy2fJtmN.d.cts +80 -0
  88. package/dist/{mod-0EysZ-dJ.d.ts → mod-GetHzY6F.d.ts} +2 -2
  89. package/dist/mod-fxr25Gv7.d.cts +107 -0
  90. package/dist/mod.cjs +137 -0
  91. package/dist/mod.d.cts +15 -0
  92. package/dist/mod.d.ts +15 -18
  93. package/dist/mod.js +19 -21
  94. package/dist/negotiation-B4NJHk1f.js +71 -0
  95. package/dist/nodeinfo/client.test.js +32 -114
  96. package/dist/nodeinfo/handler.test.js +35 -30
  97. package/dist/nodeinfo/mod.cjs +10 -0
  98. package/dist/nodeinfo/mod.d.cts +3 -0
  99. package/dist/nodeinfo/mod.d.ts +3 -5
  100. package/dist/nodeinfo/mod.js +6 -7
  101. package/dist/nodeinfo/types.test.js +10 -18
  102. package/dist/nodeinfo-BnthBobC.js +4 -0
  103. package/dist/nodeinfo-CdN0rEnZ.cjs +4 -0
  104. package/dist/otel/exporter.test.js +899 -0
  105. package/dist/otel/mod.cjs +262 -0
  106. package/dist/otel/mod.d.cts +230 -0
  107. package/dist/otel/mod.d.ts +232 -0
  108. package/dist/otel/mod.js +261 -0
  109. package/dist/owner-B4HbyP8s.d.cts +67 -0
  110. package/dist/{owner-smArESGi.js → owner-DQuVKHuY.js} +46 -8
  111. package/dist/{owner-CQPnQVtf.d.ts → owner-kQRGVXG1.d.ts} +3 -3
  112. package/dist/{proof-CT1SITRP.js → proof-BG2G4cDG.js} +53 -16
  113. package/dist/proof-C3K5Z8RT.cjs +710 -0
  114. package/dist/{proof-C6z-uqeO.js → proof-GrivUN5L.js} +5 -3
  115. package/dist/router-CVRQXlZi.js +118 -0
  116. package/dist/{send-1zdmNlUo.js → send-B_dTZyUD.js} +9 -4
  117. package/dist/sig/http.test.js +19 -17
  118. package/dist/sig/key.test.js +15 -14
  119. package/dist/sig/ld.test.js +13 -12
  120. package/dist/sig/mod.cjs +28 -0
  121. package/dist/sig/mod.d.cts +6 -0
  122. package/dist/sig/mod.d.ts +5 -7
  123. package/dist/sig/mod.js +8 -10
  124. package/dist/sig/owner.test.js +40 -15
  125. package/dist/sig/proof.test.js +19 -17
  126. package/dist/sig-C34-oHBl.js +4 -0
  127. package/dist/sig-YYj5tCnr.cjs +4 -0
  128. package/dist/{std__assert-X-_kMxKM.js → std__assert-Cm-MfI66.js} +1 -1
  129. package/dist/testing/mod.d.ts +410 -232
  130. package/dist/testing/mod.js +9 -4
  131. package/dist/{transformers-Dna8Fg7k.js → transformers-BFT6d7J5.js} +3 -3
  132. package/dist/transformers-CoBS-oFG.cjs +116 -0
  133. package/dist/type-BSNcIxTd.js +14 -0
  134. package/dist/{types-BzyGRkRt.js → types-BtUjyi5y.js} +9 -170
  135. package/dist/types-CWgzGaqk.cjs +315 -0
  136. package/dist/{types-BIgY6c-l.js → types-D2jhK2VG.js} +1 -3
  137. package/dist/{runtime/authdocloader.test.js → utils/docloader.test.js} +20 -18
  138. package/dist/utils/kv-cache.test.js +211 -0
  139. package/dist/utils/mod.cjs +12 -0
  140. package/dist/utils/mod.d.cts +5 -0
  141. package/dist/utils/mod.d.ts +7 -0
  142. package/dist/utils/mod.js +11 -0
  143. package/dist/utils-D-Va7aXC.js +4 -0
  144. package/dist/utils-DyRU1gdZ.cjs +4 -0
  145. package/dist/vocab/actor.test.js +15 -13
  146. package/dist/vocab/lookup.test.js +285 -12
  147. package/dist/vocab/mod.cjs +86 -0
  148. package/dist/vocab/mod.d.cts +4 -0
  149. package/dist/vocab/mod.d.ts +3 -5
  150. package/dist/vocab/mod.js +6 -7
  151. package/dist/vocab/type.test.js +4 -4
  152. package/dist/vocab/vocab.test.js +8058 -1987
  153. package/dist/{vocab-Bg1J3mu4.js → vocab-Aig1Fmi8.js} +32 -18
  154. package/dist/{vocab-SOE1ifCr.d.ts → vocab-BCWe1Ih5.d.ts} +292 -21
  155. package/dist/{type-I68qwqmo.js → vocab-C3nSleOZ.js} +6947 -7381
  156. package/dist/vocab-CeDBzu-f.d.cts +14903 -0
  157. package/dist/vocab-DFMYh9aV.cjs +296 -0
  158. package/dist/webfinger/handler.test.js +62 -29
  159. package/dist/webfinger/lookup.test.js +11 -12
  160. package/dist/webfinger/mod.cjs +8 -0
  161. package/dist/webfinger/mod.d.cts +2 -0
  162. package/dist/webfinger/mod.d.ts +1 -4
  163. package/dist/webfinger/mod.js +5 -6
  164. package/dist/webfinger-C72Y8lrh.js +4 -0
  165. package/dist/webfinger-vAtLmxOF.cjs +4 -0
  166. package/package.json +81 -45
  167. package/dist/assert_throws-BOO88avQ.js +0 -39
  168. package/dist/authdocloader-Bq0gEHRj.js +0 -52
  169. package/dist/compat-Bb5myD13.js +0 -4
  170. package/dist/denokv-Bv33Xxea.js +0 -57
  171. package/dist/docloader-BlVueewg.js +0 -4615
  172. package/dist/docloader-CxWcuWqQ.d.ts +0 -221
  173. package/dist/fixtures/activitypub.academy/users/brauca_darradiul.json +0 -83
  174. package/dist/fixtures/example.com/announce.json +0 -6
  175. package/dist/fixtures/example.com/collection.json +0 -19
  176. package/dist/fixtures/example.com/create.json +0 -6
  177. package/dist/fixtures/example.com/cross-origin-actor.json +0 -6
  178. package/dist/fixtures/example.com/hong-gildong.json +0 -11
  179. package/dist/fixtures/example.com/invite.json +0 -7
  180. package/dist/fixtures/example.com/key.json +0 -7
  181. package/dist/fixtures/example.com/key2.json +0 -6
  182. package/dist/fixtures/example.com/object.json +0 -6
  183. package/dist/fixtures/example.com/orderedcollectionpage.json +0 -24
  184. package/dist/fixtures/example.com/paged/a.json +0 -13
  185. package/dist/fixtures/example.com/paged/b.json +0 -16
  186. package/dist/fixtures/example.com/paged-collection.json +0 -6
  187. package/dist/fixtures/example.com/person.json +0 -22
  188. package/dist/fixtures/example.com/person2.json +0 -40
  189. package/dist/fixtures/example.com/test.json +0 -5
  190. package/dist/fixtures/example.com/users/handle.json +0 -16
  191. package/dist/fixtures/example.com/wrong-type.json +0 -3
  192. package/dist/fixtures/oeee.cafe/ap/users/3609fd4e-d51d-4db8-9f04-4189815864dd.json +0 -24
  193. package/dist/fixtures/remote.domain/users/bob.json +0 -20
  194. package/dist/fixtures/server.example/users/alice.json +0 -20
  195. package/dist/fixtures/w3id.org/identity/v1.json +0 -152
  196. package/dist/fixtures/w3id.org/security/data-integrity/v1.json +0 -74
  197. package/dist/fixtures/w3id.org/security/multikey/v1.json +0 -35
  198. package/dist/fixtures/w3id.org/security/v1.json +0 -50
  199. package/dist/fixtures/wizard.casa/users/hongminhee.json +0 -69
  200. package/dist/fixtures/www.w3.org/ns/activitystreams.json +0 -379
  201. package/dist/fixtures/www.w3.org/ns/did/v1.json +0 -58
  202. package/dist/key-Dn7Lram-.js +0 -260
  203. package/dist/key-S7WllAWz.js +0 -10
  204. package/dist/key-rRCUafNm.js +0 -10
  205. package/dist/middleware-CWbGhXnl.js +0 -26
  206. package/dist/middleware-D-OlNiyj.js +0 -17
  207. package/dist/mod-TFoH2Ql8.d.ts +0 -104
  208. package/dist/mod-g0xFzAP9.d.ts +0 -2
  209. package/dist/mq-CRGm1e_F.d.ts +0 -143
  210. package/dist/nodeinfo/semver.test.js +0 -143
  211. package/dist/nodeinfo-CyEbLjHs.js +0 -4
  212. package/dist/runtime/docloader.test.js +0 -522
  213. package/dist/runtime/key.test.js +0 -103
  214. package/dist/runtime/langstr.test.d.ts +0 -3
  215. package/dist/runtime/langstr.test.js +0 -39
  216. package/dist/runtime/mod.d.ts +0 -8
  217. package/dist/runtime/mod.js +0 -13
  218. package/dist/runtime/multibase/multibase.test.d.ts +0 -3
  219. package/dist/runtime/multibase/multibase.test.js +0 -358
  220. package/dist/runtime/url.test.d.ts +0 -3
  221. package/dist/runtime/url.test.js +0 -45
  222. package/dist/runtime-BSkOVUWM.js +0 -4
  223. package/dist/semver-dArNLkR9.js +0 -149
  224. package/dist/sig-BXJO--F9.js +0 -4
  225. package/dist/src/vocab/accept.yaml +0 -15
  226. package/dist/src/vocab/activity.yaml +0 -98
  227. package/dist/src/vocab/add.yaml +0 -16
  228. package/dist/src/vocab/announce.yaml +0 -30
  229. package/dist/src/vocab/application.yaml +0 -324
  230. package/dist/src/vocab/arrive.yaml +0 -15
  231. package/dist/src/vocab/article.yaml +0 -46
  232. package/dist/src/vocab/audio.yaml +0 -11
  233. package/dist/src/vocab/block.yaml +0 -16
  234. package/dist/src/vocab/chatmessage.yaml +0 -50
  235. package/dist/src/vocab/collection.yaml +0 -154
  236. package/dist/src/vocab/collectionpage.yaml +0 -55
  237. package/dist/src/vocab/create.yaml +0 -28
  238. package/dist/src/vocab/dataintegrityproof.yaml +0 -56
  239. package/dist/src/vocab/delete.yaml +0 -27
  240. package/dist/src/vocab/didservice.yaml +0 -22
  241. package/dist/src/vocab/dislike.yaml +0 -14
  242. package/dist/src/vocab/document.yaml +0 -31
  243. package/dist/src/vocab/emoji.yaml +0 -12
  244. package/dist/src/vocab/emojireact.yaml +0 -17
  245. package/dist/src/vocab/endpoints.yaml +0 -85
  246. package/dist/src/vocab/event.yaml +0 -11
  247. package/dist/src/vocab/export.yaml +0 -9
  248. package/dist/src/vocab/flag.yaml +0 -15
  249. package/dist/src/vocab/follow.yaml +0 -19
  250. package/dist/src/vocab/group.yaml +0 -324
  251. package/dist/src/vocab/hashtag.yaml +0 -14
  252. package/dist/src/vocab/ignore.yaml +0 -14
  253. package/dist/src/vocab/image.yaml +0 -9
  254. package/dist/src/vocab/intransitiveactivity.yaml +0 -15
  255. package/dist/src/vocab/invite.yaml +0 -14
  256. package/dist/src/vocab/join.yaml +0 -14
  257. package/dist/src/vocab/key.yaml +0 -28
  258. package/dist/src/vocab/leave.yaml +0 -14
  259. package/dist/src/vocab/like.yaml +0 -16
  260. package/dist/src/vocab/link.yaml +0 -101
  261. package/dist/src/vocab/listen.yaml +0 -12
  262. package/dist/src/vocab/mention.yaml +0 -9
  263. package/dist/src/vocab/move.yaml +0 -15
  264. package/dist/src/vocab/multikey.yaml +0 -36
  265. package/dist/src/vocab/note.yaml +0 -48
  266. package/dist/src/vocab/object.yaml +0 -404
  267. package/dist/src/vocab/offer.yaml +0 -15
  268. package/dist/src/vocab/orderedcollection.yaml +0 -39
  269. package/dist/src/vocab/orderedcollectionpage.yaml +0 -50
  270. package/dist/src/vocab/organization.yaml +0 -324
  271. package/dist/src/vocab/page.yaml +0 -11
  272. package/dist/src/vocab/person.yaml +0 -324
  273. package/dist/src/vocab/place.yaml +0 -75
  274. package/dist/src/vocab/profile.yaml +0 -26
  275. package/dist/src/vocab/propertyvalue.yaml +0 -32
  276. package/dist/src/vocab/question.yaml +0 -103
  277. package/dist/src/vocab/read.yaml +0 -13
  278. package/dist/src/vocab/reject.yaml +0 -14
  279. package/dist/src/vocab/relationship.yaml +0 -52
  280. package/dist/src/vocab/remove.yaml +0 -14
  281. package/dist/src/vocab/service.yaml +0 -324
  282. package/dist/src/vocab/source.yaml +0 -26
  283. package/dist/src/vocab/tentativeaccept.yaml +0 -14
  284. package/dist/src/vocab/tentativereject.yaml +0 -14
  285. package/dist/src/vocab/tombstone.yaml +0 -24
  286. package/dist/src/vocab/travel.yaml +0 -16
  287. package/dist/src/vocab/undo.yaml +0 -26
  288. package/dist/src/vocab/update.yaml +0 -58
  289. package/dist/src/vocab/video.yaml +0 -11
  290. package/dist/src/vocab/view.yaml +0 -13
  291. package/dist/testing/docloader.test.js +0 -24
  292. package/dist/vocab/schema.yaml +0 -247
  293. package/dist/webfinger-C3GIyXIg.js +0 -4
  294. package/dist/x/cfworkers.d.ts +0 -61
  295. package/dist/x/cfworkers.js +0 -98
  296. package/dist/x/cfworkers.test.d.ts +0 -3
  297. package/dist/x/cfworkers.test.js +0 -179
  298. package/dist/x/hono.d.ts +0 -56
  299. package/dist/x/hono.js +0 -60
  300. package/dist/x/sveltekit.d.ts +0 -48
  301. package/dist/x/sveltekit.js +0 -68
  302. /package/dist/{assert_equals-DSbWqCm3.js → assert_equals-Gbplq4lg.js} +0 -0
  303. /package/dist/{collection-CSzG2j1P.js → collection-CrkRM5Ep.js} +0 -0
  304. /package/dist/{nodeinfo/semver.test.d.ts → federation/idempotency.test.d.ts} +0 -0
  305. /package/dist/{runtime/authdocloader.test.d.ts → federation/negotiation.test.d.ts} +0 -0
  306. /package/dist/{mod-1pDWKvUL.d.ts → mod-CVgZgliM.d.ts} +0 -0
  307. /package/dist/{mod-GIh5OYxW.d.ts → mod-bjzj5QIb.d.ts} +0 -0
  308. /package/dist/{runtime/docloader.test.d.ts → otel/exporter.test.d.ts} +0 -0
  309. /package/dist/{retry-D4GJ670a.js → retry-Bz5pP75o.js} +0 -0
  310. /package/dist/{testing → utils}/docloader.test.d.ts +0 -0
  311. /package/dist/{runtime/key.test.d.ts → utils/kv-cache.test.d.ts} +0 -0
@@ -0,0 +1,128 @@
1
+ import { Application, Group, Organization, Person, Service } from "./vocab-CeDBzu-f.cjs";
2
+ import { GetUserAgentOptions } from "@fedify/vocab-runtime";
3
+ import { TracerProvider } from "@opentelemetry/api";
4
+
5
+ //#region src/vocab/actor.d.ts
6
+ /**
7
+ * Actor types are {@link Object} types that are capable of performing
8
+ * activities.
9
+ */
10
+ type Actor = Application | Group | Organization | Person | Service;
11
+ /**
12
+ * Checks if the given object is an {@link Actor}.
13
+ * @param object The object to check.
14
+ * @returns `true` if the given object is an {@link Actor}.
15
+ */
16
+ declare function isActor(object: unknown): object is Actor;
17
+ /**
18
+ * A string representation of an actor type name.
19
+ */
20
+ type ActorTypeName = "Application" | "Group" | "Organization" | "Person" | "Service";
21
+ /**
22
+ * Gets the type name of the given actor.
23
+ * @param actor The actor to get the type name of.
24
+ * @returns The type name of the given actor.
25
+ */
26
+ declare function getActorTypeName(actor: Actor): ActorTypeName;
27
+ /**
28
+ * Gets the actor class by the given type name.
29
+ * @param typeName The type name to get the actor class by.
30
+ * @returns The actor class by the given type name.
31
+ */
32
+ declare function getActorClassByTypeName(typeName: ActorTypeName): typeof Application | typeof Group | typeof Organization | typeof Person | typeof Service;
33
+ /**
34
+ * Options for {@link getActorHandle}.
35
+ * @since 1.3.0
36
+ */
37
+ interface GetActorHandleOptions extends NormalizeActorHandleOptions {
38
+ /**
39
+ * The options for making `User-Agent` header.
40
+ * If a string is given, it is used as the `User-Agent` header value.
41
+ * If an object is given, it is passed to {@link getUserAgent} to generate
42
+ * the `User-Agent` header value.
43
+ * @since 1.3.0
44
+ */
45
+ userAgent?: GetUserAgentOptions | string;
46
+ /**
47
+ * The OpenTelemetry tracer provider. If omitted, the global tracer provider
48
+ * is used.
49
+ * @since 1.3.0
50
+ */
51
+ tracerProvider?: TracerProvider;
52
+ }
53
+ /**
54
+ * Gets the actor handle, of the form `@username@domain`, from the given actor
55
+ * or an actor URI.
56
+ *
57
+ * @example
58
+ * ``` typescript
59
+ * // Get the handle of an actor object:
60
+ * await getActorHandle(
61
+ * new Person({ id: new URL("https://fosstodon.org/users/hongminhee") })
62
+ * );
63
+ *
64
+ * // Get the handle of an actor URI:
65
+ * await getActorHandle(new URL("https://fosstodon.org/users/hongminhee"));
66
+ * ```
67
+ *
68
+ * @param actor The actor or actor URI to get the handle from.
69
+ * @param options The extra options for getting the actor handle.
70
+ * @returns The actor handle. It starts with `@` and is followed by the
71
+ * username and domain, separated by `@` by default (it can be
72
+ * customized with the options).
73
+ * @throws {TypeError} If the actor does not have enough information to get the
74
+ * handle.
75
+ * @since 0.4.0
76
+ */
77
+ declare function getActorHandle(actor: Actor | URL, options?: GetActorHandleOptions): Promise<`@${string}@${string}` | `${string}@${string}`>;
78
+ /**
79
+ * Options for {@link normalizeActorHandle}.
80
+ * @since 0.9.0
81
+ */
82
+ interface NormalizeActorHandleOptions {
83
+ /**
84
+ * Whether to trim the leading `@` from the actor handle. Turned off by
85
+ * default.
86
+ */
87
+ trimLeadingAt?: boolean;
88
+ /**
89
+ * Whether to convert the domain part of the actor handle to punycode, if it
90
+ * is an internationalized domain name. Turned off by default.
91
+ */
92
+ punycode?: boolean;
93
+ }
94
+ /**
95
+ * Normalizes the given actor handle.
96
+ * @param handle The full handle of the actor to normalize.
97
+ * @param options The options for normalizing the actor handle.
98
+ * @returns The normalized actor handle.
99
+ * @throws {TypeError} If the actor handle is invalid.
100
+ * @since 0.9.0
101
+ */
102
+ declare function normalizeActorHandle(handle: string, options?: NormalizeActorHandleOptions): `@${string}@${string}` | `${string}@${string}`;
103
+ /**
104
+ * The object that can be a recipient of an activity.
105
+ *
106
+ * Note that every {@link Actor} is also a {@link Recipient}.
107
+ */
108
+ interface Recipient {
109
+ /**
110
+ * The URI of the actor.
111
+ */
112
+ readonly id: URL | null;
113
+ /**
114
+ * The URI of the actor's inbox.
115
+ */
116
+ readonly inboxId: URL | null;
117
+ /**
118
+ * The endpoints of the actor.
119
+ */
120
+ readonly endpoints?: {
121
+ /**
122
+ * The URI of the actor's shared inbox.
123
+ */
124
+ sharedInbox: URL | null;
125
+ } | null;
126
+ }
127
+ //#endregion
128
+ export { Actor, ActorTypeName, GetActorHandleOptions, NormalizeActorHandleOptions, Recipient, getActorClassByTypeName, getActorHandle, getActorTypeName, isActor, normalizeActorHandle };
@@ -3,7 +3,7 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { AssertionError } from "./assert_equals-DSbWqCm3.js";
6
+ import { AssertionError } from "./assert_equals-Gbplq4lg.js";
7
7
 
8
8
  //#region ../../node_modules/.pnpm/@jsr+std__assert@0.226.0/node_modules/@jsr/std__assert/assert.js
9
9
  /**
@@ -3,7 +3,7 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { AssertionError } from "./assert_equals-DSbWqCm3.js";
6
+ import { AssertionError } from "./assert_equals-Gbplq4lg.js";
7
7
 
8
8
  //#region ../../node_modules/.pnpm/@jsr+std__assert@0.226.0/node_modules/@jsr/std__assert/assert_instance_of.js
9
9
  /**
@@ -3,7 +3,7 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { AssertionError, equal } from "./assert_equals-DSbWqCm3.js";
6
+ import { AssertionError, equal } from "./assert_equals-Gbplq4lg.js";
7
7
 
8
8
  //#region ../../node_modules/.pnpm/@jsr+std__assert@0.226.0/node_modules/@jsr/std__assert/assert_not_equals.js
9
9
  /**
@@ -3,8 +3,8 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { AssertionError } from "./assert_equals-DSbWqCm3.js";
7
- import { assertIsError } from "./assert_is_error-BPGph1Jx.js";
6
+ import { AssertionError } from "./assert_equals-Gbplq4lg.js";
7
+ import { assertIsError } from "./assert_throws-DjkXin1a.js";
8
8
 
9
9
  //#region ../../node_modules/.pnpm/@jsr+std__assert@0.226.0/node_modules/@jsr/std__assert/assert_false.js
10
10
  /**
@@ -3,7 +3,7 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { AssertionError, stripAnsiCode } from "./assert_equals-DSbWqCm3.js";
6
+ import { AssertionError, stripAnsiCode } from "./assert_equals-Gbplq4lg.js";
7
7
 
8
8
  //#region ../../node_modules/.pnpm/@jsr+std__assert@0.226.0/node_modules/@jsr/std__assert/assert_is_error.js
9
9
  /**
@@ -45,4 +45,34 @@ import { AssertionError, stripAnsiCode } from "./assert_equals-DSbWqCm3.js";
45
45
  }
46
46
 
47
47
  //#endregion
48
- export { assertIsError };
48
+ //#region ../../node_modules/.pnpm/@jsr+std__assert@0.226.0/node_modules/@jsr/std__assert/assert_throws.js
49
+ function assertThrows(fn, errorClassOrMsg, msgIncludesOrMsg, msg) {
50
+ let ErrorClass = void 0;
51
+ let msgIncludes = void 0;
52
+ let err;
53
+ if (typeof errorClassOrMsg !== "string") if (errorClassOrMsg === void 0 || errorClassOrMsg?.prototype instanceof Error || errorClassOrMsg?.prototype === Error.prototype) {
54
+ ErrorClass = errorClassOrMsg;
55
+ msgIncludes = msgIncludesOrMsg;
56
+ } else msg = msgIncludesOrMsg;
57
+ else msg = errorClassOrMsg;
58
+ let doesThrow = false;
59
+ const msgSuffix = msg ? `: ${msg}` : ".";
60
+ try {
61
+ fn();
62
+ } catch (error) {
63
+ if (ErrorClass) {
64
+ if (error instanceof Error === false) throw new AssertionError(`A non-Error object was thrown${msgSuffix}`);
65
+ assertIsError(error, ErrorClass, msgIncludes, msg);
66
+ }
67
+ err = error;
68
+ doesThrow = true;
69
+ }
70
+ if (!doesThrow) {
71
+ msg = `Expected function to throw${msgSuffix}`;
72
+ throw new AssertionError(msg);
73
+ }
74
+ return err;
75
+ }
76
+
77
+ //#endregion
78
+ export { assertIsError, assertThrows };
@@ -3,9 +3,10 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { deno_default, getTypeId } from "./type-I68qwqmo.js";
7
- import { Router, RouterError } from "./lookup-DNQyH8UQ.js";
8
- import { InboxListenerSet } from "./inbox-eK2W2MF3.js";
6
+ import { deno_default } from "./deno-BTeveqhY.js";
7
+ import { Router, RouterError } from "./router-CVRQXlZi.js";
8
+ import { getTypeId } from "./type-BSNcIxTd.js";
9
+ import { InboxListenerSet } from "./inbox-DNjplQSR.js";
9
10
  import { getLogger } from "@logtape/logtape";
10
11
  import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
11
12
 
@@ -14,6 +15,7 @@ var FederationBuilderImpl = class {
14
15
  router;
15
16
  actorCallbacks;
16
17
  nodeInfoDispatcher;
18
+ webFingerLinksDispatcher;
17
19
  objectCallbacks;
18
20
  objectTypeIds;
19
21
  inboxPath;
@@ -27,6 +29,7 @@ var FederationBuilderImpl = class {
27
29
  inboxListeners;
28
30
  inboxErrorHandler;
29
31
  sharedInboxKeyDispatcher;
32
+ idempotencyStrategy;
30
33
  collectionTypeIds;
31
34
  collectionCallbacks;
32
35
  /**
@@ -41,7 +44,7 @@ var FederationBuilderImpl = class {
41
44
  this.collectionTypeIds = {};
42
45
  }
43
46
  async build(options) {
44
- const { FederationImpl } = await import("./middleware-CWbGhXnl.js");
47
+ const { FederationImpl } = await import("./middleware-7Yg2p_nl.js");
45
48
  const f = new FederationImpl(options);
46
49
  const trailingSlashInsensitiveValue = f.router.trailingSlashInsensitive;
47
50
  f.router = this.router.clone();
@@ -49,6 +52,7 @@ var FederationBuilderImpl = class {
49
52
  f._initializeRouter();
50
53
  f.actorCallbacks = this.actorCallbacks == null ? void 0 : { ...this.actorCallbacks };
51
54
  f.nodeInfoDispatcher = this.nodeInfoDispatcher;
55
+ f.webFingerLinksDispatcher = this.webFingerLinksDispatcher;
52
56
  f.objectCallbacks = { ...this.objectCallbacks };
53
57
  f.objectTypeIds = { ...this.objectTypeIds };
54
58
  f.inboxPath = this.inboxPath;
@@ -62,6 +66,7 @@ var FederationBuilderImpl = class {
62
66
  f.inboxListeners = this.inboxListeners?.clone();
63
67
  f.inboxErrorHandler = this.inboxErrorHandler;
64
68
  f.sharedInboxKeyDispatcher = this.sharedInboxKeyDispatcher;
69
+ f.idempotencyStrategy = this.idempotencyStrategy;
65
70
  return f;
66
71
  }
67
72
  _getTracer() {
@@ -186,6 +191,9 @@ var FederationBuilderImpl = class {
186
191
  if (variables.size !== 0) throw new RouterError("Path for NodeInfo dispatcher must have no variables.");
187
192
  this.nodeInfoDispatcher = dispatcher;
188
193
  }
194
+ setWebFingerLinksDispatcher(dispatcher) {
195
+ this.webFingerLinksDispatcher = dispatcher;
196
+ }
189
197
  setObjectDispatcher(cls, path, dispatcher) {
190
198
  const routeName = `object:${cls.typeId.href}`;
191
199
  if (this.router.has(routeName)) throw new RouterError(`Object dispatcher for ${cls.name} already set.`);
@@ -481,15 +489,19 @@ var FederationBuilderImpl = class {
481
489
  setSharedKeyDispatcher: (dispatcher) => {
482
490
  this.sharedInboxKeyDispatcher = dispatcher;
483
491
  return setters;
492
+ },
493
+ withIdempotency: (strategy) => {
494
+ this.idempotencyStrategy = strategy;
495
+ return setters;
484
496
  }
485
497
  };
486
498
  return setters;
487
499
  }
488
- setCollectionDispatcher(name, ...args) {
489
- return this.#setCustomCollectionDispatcher(name, "collection", ...args);
500
+ setCollectionDispatcher(name, itemType, path, dispatcher) {
501
+ return this.#setCustomCollectionDispatcher(name, "collection", itemType, path, dispatcher);
490
502
  }
491
- setOrderedCollectionDispatcher(name, ...args) {
492
- return this.#setCustomCollectionDispatcher(name, "orderedCollection", ...args);
503
+ setOrderedCollectionDispatcher(name, itemType, path, dispatcher) {
504
+ return this.#setCustomCollectionDispatcher(name, "orderedCollection", itemType, path, dispatcher);
493
505
  }
494
506
  #setCustomCollectionDispatcher(name, collectionType, itemType, path, dispatcher) {
495
507
  const strName = String(name);
@@ -0,0 +1,34 @@
1
+
2
+ const { Temporal } = require("@js-temporal/polyfill");
3
+ const { URLPattern } = require("urlpattern-polyfill");
4
+
5
+ //#region rolldown:runtime
6
+ var __create = Object.create;
7
+ var __defProp = Object.defineProperty;
8
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
9
+ var __getOwnPropNames = Object.getOwnPropertyNames;
10
+ var __getProtoOf = Object.getPrototypeOf;
11
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
14
+ key = keys[i];
15
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
16
+ get: ((k) => from[k]).bind(null, key),
17
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
18
+ });
19
+ }
20
+ return to;
21
+ };
22
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
23
+ value: mod,
24
+ enumerable: true
25
+ }) : target, mod));
26
+
27
+ //#endregion
28
+
29
+ Object.defineProperty(exports, '__toESM', {
30
+ enumerable: true,
31
+ get: function () {
32
+ return __toESM;
33
+ }
34
+ });
@@ -0,0 +1,41 @@
1
+
2
+ import { Temporal } from "@js-temporal/polyfill";
3
+ import { URLPattern } from "urlpattern-polyfill";
4
+ globalThis.addEventListener = () => {};
5
+
6
+ import { createRequire } from "node:module";
7
+
8
+ //#region rolldown:runtime
9
+ var __create = Object.create;
10
+ var __defProp = Object.defineProperty;
11
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
12
+ var __getOwnPropNames = Object.getOwnPropertyNames;
13
+ var __getProtoOf = Object.getPrototypeOf;
14
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
15
+ var __commonJS = (cb, mod) => function() {
16
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
17
+ };
18
+ var __export = (target, all) => {
19
+ for (var name in all) __defProp(target, name, {
20
+ get: all[name],
21
+ enumerable: true
22
+ });
23
+ };
24
+ var __copyProps = (to, from, except, desc) => {
25
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
26
+ key = keys[i];
27
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
28
+ get: ((k) => from[k]).bind(null, key),
29
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
30
+ });
31
+ }
32
+ return to;
33
+ };
34
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
35
+ value: mod,
36
+ enumerable: true
37
+ }) : target, mod));
38
+ var __require = /* @__PURE__ */ createRequire(import.meta.url);
39
+
40
+ //#endregion
41
+ export { __commonJS, __export, __require, __toESM };
@@ -0,0 +1,222 @@
1
+ import { GetUserAgentOptions } from "@fedify/vocab-runtime";
2
+
3
+ //#region src/nodeinfo/types.d.ts
4
+ /**
5
+ * The type of the result of parsing JSON.
6
+ */
7
+ type JsonValue = {
8
+ [key: string]: JsonValue | undefined;
9
+ } | JsonValue[] | string | number | boolean | null;
10
+ /**
11
+ * A NodeInfo object as defined in the NodeInfo 2.1 schema.
12
+ */
13
+ interface NodeInfo {
14
+ /**
15
+ * Metadata about server software in use.
16
+ */
17
+ software: Software;
18
+ /**
19
+ * The protocols supported on this server. At least one protocol must be
20
+ * supported.
21
+ */
22
+ protocols: Protocol[];
23
+ /**
24
+ * The third party sites this server can connect to via their application API.
25
+ */
26
+ services?: Services;
27
+ /**
28
+ * Whether this server allows open self-registration. Defaults to `false`.
29
+ */
30
+ openRegistrations?: boolean;
31
+ /**
32
+ * Usage statistics for this server.
33
+ */
34
+ usage: Usage;
35
+ /**
36
+ * Free form key value pairs for software specific values.
37
+ * Clients should not rely on any specific key present.
38
+ */
39
+ metadata?: Record<string, JsonValue>;
40
+ }
41
+ /**
42
+ * Metadata about server software in use.
43
+ */
44
+ interface Software {
45
+ /**
46
+ * The canonical name of this server software. This must comply with
47
+ * pattern `/^[a-z0-9-]+$/`.
48
+ */
49
+ name: string;
50
+ /**
51
+ * The version of this server software.
52
+ */
53
+ version: string;
54
+ /**
55
+ * The URL of the source code repository of this server software.
56
+ */
57
+ repository?: URL;
58
+ /**
59
+ * The URL of the homepage of this server software.
60
+ */
61
+ homepage?: URL;
62
+ }
63
+ /**
64
+ * The protocols supported on this server.
65
+ */
66
+ type Protocol = "activitypub" | "buddycloud" | "dfrn" | "diaspora" | "libertree" | "ostatus" | "pumpio" | "tent" | "xmpp" | "zot";
67
+ /**
68
+ * The third party sites this server can connect to via their application API.
69
+ */
70
+ interface Services {
71
+ /**
72
+ * The third party sites this server can retrieve messages from for combined
73
+ * display with regular traffic.
74
+ */
75
+ inbound?: InboundService[];
76
+ /**
77
+ * The third party sites this server can publish messages to on the behalf
78
+ * of a user.
79
+ */
80
+ outbound?: OutboundService[];
81
+ }
82
+ /**
83
+ * The third party sites this server can retrieve messages from for combined
84
+ * display with regular traffic.
85
+ */
86
+ type InboundService = "atom1.0" | "gnusocial" | "imap" | "pnut" | "pop3" | "pumpio" | "rss2.0" | "twitter";
87
+ /**
88
+ * The third party sites this server can publish messages to on the behalf
89
+ * of a user.
90
+ */
91
+ type OutboundService = "atom1.0" | "blogger" | "buddycloud" | "diaspora" | "dreamwidth" | "drupal" | "facebook" | "friendica" | "gnusocial" | "google" | "insanejournal" | "libertree" | "linkedin" | "livejournal" | "mediagoblin" | "myspace" | "pinterest" | "pnut" | "posterous" | "pumpio" | "redmatrix" | "rss2.0" | "smtp" | "tent" | "tumblr" | "twitter" | "wordpress" | "xmpp";
92
+ /**
93
+ * Usage statistics for this server.
94
+ */
95
+ interface Usage {
96
+ /**
97
+ * Statistics about the users of this server.
98
+ */
99
+ users: {
100
+ /**
101
+ * The total amount of on this server registered users. This number
102
+ * has to be an integer greater than or equal to zero.
103
+ */
104
+ total?: number;
105
+ /**
106
+ * The amount of users that signed in at least once in the last 180 days.
107
+ * This number has to be an integer greater than or equal to zero.
108
+ */
109
+ activeHalfyear?: number;
110
+ /**
111
+ * The amount of users that signed in at least once in the last 30 days.
112
+ * This number has to be an integer greater than or equal to zero.
113
+ */
114
+ activeMonth?: number;
115
+ };
116
+ /**
117
+ * The amount of posts that were made by users that are registered on this
118
+ * server. This number has to be an integer greater than or equal to zero.
119
+ */
120
+ localPosts: number;
121
+ /**
122
+ * The amount of comments that were made by users that are registered on this
123
+ * server. This number has to be an integer greater than or equal to zero.
124
+ */
125
+ localComments: number;
126
+ }
127
+ /**
128
+ * Converts a {@link NodeInfo} object to a JSON value.
129
+ * @param nodeInfo The {@link NodeInfo} object to convert.
130
+ * @returns The JSON value that complies with the NodeInfo schema.
131
+ * @throws {TypeError} If the {@link NodeInfo} object is invalid.
132
+ */
133
+ declare function nodeInfoToJson(nodeInfo: NodeInfo): JsonValue;
134
+ //#endregion
135
+ //#region src/nodeinfo/client.d.ts
136
+ /**
137
+ * Options for {@link getNodeInfo} function.
138
+ * @since 1.2.0
139
+ */
140
+ interface GetNodeInfoOptions {
141
+ /**
142
+ * Whether to directly fetch the NodeInfo document from the given URL.
143
+ * Otherwise, the NodeInfo document will be fetched from the `.well-known`
144
+ * location of the given URL.
145
+ *
146
+ * Turned off by default.
147
+ */
148
+ direct?: boolean;
149
+ /**
150
+ * How strictly to parse the NodeInfo document.
151
+ *
152
+ * - `"strict"`: Parse the NodeInfo document strictly. If the document is
153
+ * invalid, `undefined` is returned. This is the default.
154
+ * - `"best-effort"`: Try to parse the NodeInfo document even if it is
155
+ * invalid.
156
+ * - `"none"`: Do not parse the NodeInfo document. The function will return
157
+ * the raw JSON value.
158
+ */
159
+ parse?: "strict" | "best-effort" | "none";
160
+ /**
161
+ * The options for making `User-Agent` header.
162
+ * If a string is given, it is used as the `User-Agent` header value.
163
+ * If an object is given, it is passed to {@link getUserAgent} to generate
164
+ * the `User-Agent` header value.
165
+ * @since 1.3.0
166
+ */
167
+ userAgent?: GetUserAgentOptions | string;
168
+ }
169
+ /**
170
+ * Fetches a NodeInfo document from the given URL.
171
+ * @param url The base URL of the server. If `options.direct` is turned off
172
+ * (default), the NodeInfo document will be fetched from
173
+ * the `.well-known` location of this URL (hence the only origin
174
+ * of the URL is used). If `options.direct` is turned on,
175
+ * the NodeInfo document will be fetched from the given URL.
176
+ * @param options Options for fetching the NodeInfo document.
177
+ * @returns The NodeInfo document if it could be fetched successfully.
178
+ * Otherwise, `undefined` is returned.
179
+ * @since 1.2.0
180
+ */
181
+ declare function getNodeInfo(url: URL | string, options?: GetNodeInfoOptions & {
182
+ parse?: "strict" | "best-effort";
183
+ }): Promise<NodeInfo | undefined>;
184
+ /**
185
+ * Fetches a NodeInfo document from the given URL.
186
+ * @param url The base URL of the server. If `options.direct` is turned off
187
+ * (default), the NodeInfo document will be fetched from
188
+ * the `.well-known` location of this URL (hence the only origin
189
+ * of the URL is used). If `options.direct` is turned on,
190
+ * the NodeInfo document will be fetched from the given URL.
191
+ * @param options Options for fetching the NodeInfo document.
192
+ * @returns The NodeInfo document if it could be fetched successfully.
193
+ * Otherwise, `undefined` is returned.
194
+ * @since 1.2.0
195
+ */
196
+ declare function getNodeInfo(url: URL | string, options: GetNodeInfoOptions & {
197
+ parse: "none";
198
+ }): Promise<JsonValue | undefined>;
199
+ /**
200
+ * Options for {@link parseNodeInfo} function.
201
+ * @since 1.2.0
202
+ */
203
+ interface ParseNodeInfoOptions {
204
+ /**
205
+ * Whether to try to parse the NodeInfo document even if it is invalid.
206
+ * If turned on, the function will return a best-effort result.
207
+ *
208
+ * Turned off by default.
209
+ */
210
+ tryBestEffort?: boolean;
211
+ }
212
+ /**
213
+ * Parses a NodeInfo document.
214
+ * @param data A JSON value that complies with the NodeInfo schema.
215
+ * @param options Options for parsing the NodeInfo document.
216
+ * @returns The parsed NodeInfo document if it is valid. Otherwise, `null`
217
+ * is returned.
218
+ * @since 1.2.0
219
+ */
220
+ declare function parseNodeInfo(data: unknown, options?: ParseNodeInfoOptions): NodeInfo | null;
221
+ //#endregion
222
+ export { GetNodeInfoOptions, InboundService, JsonValue, NodeInfo, OutboundService, ParseNodeInfoOptions, Protocol, Services, Software, Usage, getNodeInfo, nodeInfoToJson, parseNodeInfo };