@fedify/fedify 2.0.0-dev.1604 → 2.0.0-dev.161

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 (292) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +66 -30
  3. package/dist/{assert_rejects-7UF4R_Qs.js → assert_rejects-Ce45JcFg.js} +1 -1
  4. package/dist/{assert_is_error-B035L3om.js → assert_throws-BNXdRGWP.js} +31 -1
  5. package/dist/{builder-D9zidAqR.js → builder-CulJ6Oa9.js} +15 -8
  6. package/dist/chunk-DqRYRqnO.cjs +34 -0
  7. package/dist/client-94iWEfQa.d.cts +222 -0
  8. package/dist/{client-bgSdkFa2.d.ts → client-BivSNrEg.d.ts} +1 -1
  9. package/dist/{client-Bsj0vQPr.js → client-CgMTXmAD.js} +1 -1
  10. package/dist/compat/mod.cjs +10 -0
  11. package/dist/compat/mod.d.cts +7 -0
  12. package/dist/compat/mod.d.ts +6 -12
  13. package/dist/compat/mod.js +5 -5
  14. package/dist/compat/transformers.test.js +21 -19
  15. package/dist/compat-DmDDELst.cjs +4 -0
  16. package/dist/compat-nxUqe4Z-.js +4 -0
  17. package/dist/context-Bns6uTJq.js +109 -0
  18. package/dist/{context-CDSZdQHD.d.ts → context-CYZ2i00R.d.ts} +321 -129
  19. package/dist/context-D2MrtLch.d.cts +2447 -0
  20. package/dist/deno-DIwNGswC.js +117 -0
  21. package/dist/{testing-CdBSI4xF.js → dist-B5f6a8Tt.js} +90 -111
  22. package/dist/{authdocloader-CzpPQC01.js → docloader-D2992pGD.js} +17 -8
  23. package/dist/{esm-CXF1VoeR.js → esm-DGl7uK1r.js} +32 -17
  24. package/dist/federation/builder.test.js +9 -9
  25. package/dist/federation/collection.test.js +3 -6
  26. package/dist/federation/handler.test.js +113 -145
  27. package/dist/federation/idempotency.test.js +202 -0
  28. package/dist/federation/inbox.test.js +5 -6
  29. package/dist/federation/keycache.test.js +4 -5
  30. package/dist/federation/kv.test.js +59 -7
  31. package/dist/federation/middleware.test.js +306 -111
  32. package/dist/federation/mod.cjs +25 -0
  33. package/dist/federation/mod.d.cts +7 -0
  34. package/dist/federation/mod.d.ts +7 -13
  35. package/dist/federation/mod.js +11 -16
  36. package/dist/federation/mq.test.js +7 -8
  37. package/dist/federation/negotiation.test.js +25 -0
  38. package/dist/federation/retry.test.js +2 -4
  39. package/dist/federation/router.test.js +4 -6
  40. package/dist/federation/send.test.js +53 -13
  41. package/dist/{webfinger/handler.test.js → federation/webfinger.test.js} +25 -23
  42. package/dist/federation-B431K2gm.cjs +266 -0
  43. package/dist/{federation-CMX7WzeL.js → federation-BbZwNNWj.js} +31 -9
  44. package/dist/{http-B_pxY5of.js → http-3fEbsHa0.js} +374 -14
  45. package/dist/{http-CSYNybkH.js → http-BV9SKFK0.js} +3 -2
  46. package/dist/http-C06iL_Qv.cjs +1222 -0
  47. package/dist/http-ClB3pLcL.d.cts +253 -0
  48. package/dist/{http-DqSNLFNY.d.ts → http-DLBDPal9.d.ts} +2 -2
  49. package/dist/{inbox-DoJlwIE4.js → inbox-DCV2fS3F.js} +25 -7
  50. package/dist/{key-BOzqiGbl.js → key-Bdc11xlQ.js} +3 -2
  51. package/dist/{keycache--NYDYifd.js → keycache-DRxpZ5r9.js} +1 -1
  52. package/dist/{keys-MacD9GP6.js → keys-ZbcByPg9.js} +2 -1
  53. package/dist/{kv-C7sopW2E.d.ts → kv-CtOmTRNc.d.ts} +30 -1
  54. package/dist/kv-D8q9fLkA.d.cts +110 -0
  55. package/dist/{kv-CRZrzyXm.js → kv-QzKcOQgP.js} +22 -0
  56. package/dist/kv-cache-B4-ASVht.js +122 -0
  57. package/dist/kv-cache-BEeqyGER.js +107 -0
  58. package/dist/kv-cache-CQjPwWHu.cjs +134 -0
  59. package/dist/{ld-D9oTBLrs.js → ld-C7be04RF.js} +4 -2
  60. package/dist/middleware-9RlUwILK.js +12 -0
  61. package/dist/middleware-B_mOdzoC.cjs +4242 -0
  62. package/dist/{middleware-CgNm3XOJ.js → middleware-C3xnTI2Z.js} +230 -327
  63. package/dist/{middleware-C0w2M0tb.js → middleware-C4_a2DNI.js} +272 -271
  64. package/dist/middleware-C9iGBAP1.cjs +12 -0
  65. package/dist/middleware-CYlahvpt.js +26 -0
  66. package/dist/mod-BrS8tiad.d.cts +266 -0
  67. package/dist/mod-C81L6_lQ.d.cts +1 -0
  68. package/dist/mod-CJgbdSqb.d.ts +109 -0
  69. package/dist/mod-CNNTHyBC.d.cts +80 -0
  70. package/dist/mod-CS-MS7gZ.d.cts +62 -0
  71. package/dist/{mod-RI3-KvUI.d.ts → mod-D_cmv2il.d.ts} +4 -4
  72. package/dist/mod-DcPRcifg.d.cts +107 -0
  73. package/dist/mod-DqFSzJA0.d.ts +64 -0
  74. package/dist/{mod-Drmz72EK.d.ts → mod-jOa7W503.d.ts} +3 -3
  75. package/dist/mod.cjs +55 -0
  76. package/dist/mod.d.cts +11 -0
  77. package/dist/mod.d.ts +11 -17
  78. package/dist/mod.js +15 -21
  79. package/dist/negotiation-5NPJL6zp.js +71 -0
  80. package/dist/nodeinfo/client.test.js +5 -8
  81. package/dist/nodeinfo/handler.test.js +23 -22
  82. package/dist/nodeinfo/mod.cjs +10 -0
  83. package/dist/nodeinfo/mod.d.cts +3 -0
  84. package/dist/nodeinfo/mod.d.ts +2 -4
  85. package/dist/nodeinfo/mod.js +5 -6
  86. package/dist/nodeinfo/types.test.js +4 -7
  87. package/dist/nodeinfo-BlLsRSiT.js +4 -0
  88. package/dist/nodeinfo-DuMYTpbZ.cjs +4 -0
  89. package/dist/otel/exporter.test.js +899 -0
  90. package/dist/otel/mod.cjs +262 -0
  91. package/dist/otel/mod.d.cts +230 -0
  92. package/dist/otel/mod.d.ts +232 -0
  93. package/dist/otel/mod.js +261 -0
  94. package/dist/{owner-CQPnQVtf.d.ts → owner-BgI8C-VY.d.ts} +2 -3
  95. package/dist/{owner-gB-pDKA-.js → owner-Bs5Y5twE.js} +45 -8
  96. package/dist/owner-C-zfmVAD.d.cts +66 -0
  97. package/dist/{proof-VPikK_0V.js → proof-C-751PeN.js} +50 -14
  98. package/dist/{proof-CScVkkIT.js → proof-CFwktc0B.js} +3 -2
  99. package/dist/proof-CaA7ysDp.cjs +709 -0
  100. package/dist/router-D9eI0s4b.js +118 -0
  101. package/dist/{send-flZ7H10-.js → send-C288Vw8b.js} +9 -4
  102. package/dist/sig/http.test.js +9 -11
  103. package/dist/sig/key.test.js +7 -9
  104. package/dist/sig/ld.test.js +8 -10
  105. package/dist/sig/mod.cjs +26 -0
  106. package/dist/sig/mod.d.cts +4 -0
  107. package/dist/sig/mod.d.ts +3 -7
  108. package/dist/sig/mod.js +6 -10
  109. package/dist/sig/owner.test.js +31 -10
  110. package/dist/sig/proof.test.js +11 -12
  111. package/dist/sig-CwuONEzF.js +4 -0
  112. package/dist/sig-DeXX2xnj.cjs +4 -0
  113. package/dist/testing/mod.d.ts +179 -6918
  114. package/dist/testing/mod.js +4 -4
  115. package/dist/transformers-BjBg6Lag.cjs +116 -0
  116. package/dist/{transformers-Dna8Fg7k.js → transformers-N_ip_y4P.js} +5 -5
  117. package/dist/types-Q-qkJXBV.cjs +315 -0
  118. package/dist/{types-Vo0qKhN7.js → types-hKTi53FO.js} +4 -4
  119. package/dist/{runtime/authdocloader.test.js → utils/docloader.test.js} +11 -13
  120. package/dist/utils/kv-cache.test.js +211 -0
  121. package/dist/utils/mod.cjs +10 -0
  122. package/dist/utils/mod.d.cts +4 -0
  123. package/dist/utils/mod.d.ts +6 -0
  124. package/dist/utils/mod.js +9 -0
  125. package/dist/utils-Db0ZmjcD.cjs +4 -0
  126. package/dist/utils-Wranxuoe.js +4 -0
  127. package/package.json +69 -55
  128. package/dist/actor-BC3XtGTj.js +0 -37312
  129. package/dist/actor-C22bXuuC.d.ts +0 -130
  130. package/dist/actor-CmRlosMl.js +0 -146
  131. package/dist/assert_throws-53_pKeP3.js +0 -39
  132. package/dist/authdocloader-D-DICGXT.js +0 -52
  133. package/dist/compat-Bb5myD13.js +0 -4
  134. package/dist/denokv-jZ0Z2h0M.js +0 -57
  135. package/dist/docloader-CkASOfZ5.js +0 -4615
  136. package/dist/docloader-CxWcuWqQ.d.ts +0 -221
  137. package/dist/fixtures/activitypub.academy/users/brauca_darradiul.json +0 -83
  138. package/dist/fixtures/example.com/announce.json +0 -6
  139. package/dist/fixtures/example.com/collection.json +0 -19
  140. package/dist/fixtures/example.com/create.json +0 -6
  141. package/dist/fixtures/example.com/cross-origin-actor.json +0 -6
  142. package/dist/fixtures/example.com/hong-gildong.json +0 -11
  143. package/dist/fixtures/example.com/invite.json +0 -7
  144. package/dist/fixtures/example.com/key.json +0 -7
  145. package/dist/fixtures/example.com/key2.json +0 -6
  146. package/dist/fixtures/example.com/object.json +0 -6
  147. package/dist/fixtures/example.com/orderedcollectionpage.json +0 -24
  148. package/dist/fixtures/example.com/paged/a.json +0 -13
  149. package/dist/fixtures/example.com/paged/b.json +0 -16
  150. package/dist/fixtures/example.com/paged-collection.json +0 -6
  151. package/dist/fixtures/example.com/person.json +0 -22
  152. package/dist/fixtures/example.com/person2.json +0 -40
  153. package/dist/fixtures/example.com/test.json +0 -5
  154. package/dist/fixtures/example.com/users/handle.json +0 -16
  155. package/dist/fixtures/example.com/wrong-type.json +0 -3
  156. package/dist/fixtures/oeee.cafe/ap/users/3609fd4e-d51d-4db8-9f04-4189815864dd.json +0 -24
  157. package/dist/fixtures/remote.domain/users/bob.json +0 -20
  158. package/dist/fixtures/server.example/users/alice.json +0 -20
  159. package/dist/fixtures/w3id.org/identity/v1.json +0 -152
  160. package/dist/fixtures/w3id.org/security/data-integrity/v1.json +0 -74
  161. package/dist/fixtures/w3id.org/security/multikey/v1.json +0 -35
  162. package/dist/fixtures/w3id.org/security/v1.json +0 -50
  163. package/dist/fixtures/wizard.casa/users/hongminhee.json +0 -69
  164. package/dist/fixtures/www.w3.org/ns/activitystreams.json +0 -379
  165. package/dist/fixtures/www.w3.org/ns/did/v1.json +0 -58
  166. package/dist/key-Bif4eMj7.js +0 -260
  167. package/dist/key-BteSu1lX.js +0 -10
  168. package/dist/key-DWWqeyaq.js +0 -10
  169. package/dist/lookup-Cz9VSYxw.js +0 -131
  170. package/dist/lookup-DuzrBbTj.js +0 -322
  171. package/dist/middleware-CNfiKLIZ.js +0 -25
  172. package/dist/middleware-CnvU63kV.js +0 -17
  173. package/dist/mod-Cxt4Kpf6.d.ts +0 -291
  174. package/dist/mod-DBzN0aCM.d.ts +0 -115
  175. package/dist/mod-TFoH2Ql8.d.ts +0 -104
  176. package/dist/mod-g0xFzAP9.d.ts +0 -2
  177. package/dist/mq-CRGm1e_F.d.ts +0 -143
  178. package/dist/nodeinfo-CyEbLjHs.js +0 -4
  179. package/dist/runtime/docloader.test.js +0 -522
  180. package/dist/runtime/key.test.js +0 -103
  181. package/dist/runtime/langstr.test.js +0 -39
  182. package/dist/runtime/mod.d.ts +0 -8
  183. package/dist/runtime/mod.js +0 -13
  184. package/dist/runtime/multibase/multibase.test.js +0 -358
  185. package/dist/runtime/url.test.d.ts +0 -3
  186. package/dist/runtime/url.test.js +0 -45
  187. package/dist/runtime-BSkOVUWM.js +0 -4
  188. package/dist/sig-BXJO--F9.js +0 -4
  189. package/dist/src/vocab/accept.yaml +0 -15
  190. package/dist/src/vocab/activity.yaml +0 -98
  191. package/dist/src/vocab/add.yaml +0 -16
  192. package/dist/src/vocab/announce.yaml +0 -30
  193. package/dist/src/vocab/application.yaml +0 -324
  194. package/dist/src/vocab/arrive.yaml +0 -15
  195. package/dist/src/vocab/article.yaml +0 -46
  196. package/dist/src/vocab/audio.yaml +0 -11
  197. package/dist/src/vocab/block.yaml +0 -16
  198. package/dist/src/vocab/chatmessage.yaml +0 -50
  199. package/dist/src/vocab/collection.yaml +0 -154
  200. package/dist/src/vocab/collectionpage.yaml +0 -55
  201. package/dist/src/vocab/create.yaml +0 -28
  202. package/dist/src/vocab/dataintegrityproof.yaml +0 -56
  203. package/dist/src/vocab/delete.yaml +0 -27
  204. package/dist/src/vocab/didservice.yaml +0 -22
  205. package/dist/src/vocab/dislike.yaml +0 -14
  206. package/dist/src/vocab/document.yaml +0 -31
  207. package/dist/src/vocab/emoji.yaml +0 -12
  208. package/dist/src/vocab/emojireact.yaml +0 -17
  209. package/dist/src/vocab/endpoints.yaml +0 -85
  210. package/dist/src/vocab/event.yaml +0 -11
  211. package/dist/src/vocab/export.yaml +0 -9
  212. package/dist/src/vocab/flag.yaml +0 -15
  213. package/dist/src/vocab/follow.yaml +0 -19
  214. package/dist/src/vocab/group.yaml +0 -324
  215. package/dist/src/vocab/hashtag.yaml +0 -14
  216. package/dist/src/vocab/ignore.yaml +0 -14
  217. package/dist/src/vocab/image.yaml +0 -9
  218. package/dist/src/vocab/intransitiveactivity.yaml +0 -15
  219. package/dist/src/vocab/invite.yaml +0 -14
  220. package/dist/src/vocab/join.yaml +0 -14
  221. package/dist/src/vocab/key.yaml +0 -28
  222. package/dist/src/vocab/leave.yaml +0 -14
  223. package/dist/src/vocab/like.yaml +0 -16
  224. package/dist/src/vocab/link.yaml +0 -101
  225. package/dist/src/vocab/listen.yaml +0 -12
  226. package/dist/src/vocab/mention.yaml +0 -9
  227. package/dist/src/vocab/move.yaml +0 -15
  228. package/dist/src/vocab/multikey.yaml +0 -36
  229. package/dist/src/vocab/note.yaml +0 -48
  230. package/dist/src/vocab/object.yaml +0 -404
  231. package/dist/src/vocab/offer.yaml +0 -15
  232. package/dist/src/vocab/orderedcollection.yaml +0 -39
  233. package/dist/src/vocab/orderedcollectionpage.yaml +0 -50
  234. package/dist/src/vocab/organization.yaml +0 -324
  235. package/dist/src/vocab/page.yaml +0 -11
  236. package/dist/src/vocab/person.yaml +0 -324
  237. package/dist/src/vocab/place.yaml +0 -75
  238. package/dist/src/vocab/profile.yaml +0 -26
  239. package/dist/src/vocab/propertyvalue.yaml +0 -32
  240. package/dist/src/vocab/question.yaml +0 -103
  241. package/dist/src/vocab/read.yaml +0 -13
  242. package/dist/src/vocab/reject.yaml +0 -14
  243. package/dist/src/vocab/relationship.yaml +0 -52
  244. package/dist/src/vocab/remove.yaml +0 -14
  245. package/dist/src/vocab/service.yaml +0 -324
  246. package/dist/src/vocab/source.yaml +0 -26
  247. package/dist/src/vocab/tentativeaccept.yaml +0 -14
  248. package/dist/src/vocab/tentativereject.yaml +0 -14
  249. package/dist/src/vocab/tombstone.yaml +0 -24
  250. package/dist/src/vocab/travel.yaml +0 -16
  251. package/dist/src/vocab/undo.yaml +0 -26
  252. package/dist/src/vocab/update.yaml +0 -58
  253. package/dist/src/vocab/video.yaml +0 -11
  254. package/dist/src/vocab/view.yaml +0 -13
  255. package/dist/testing/docloader.test.js +0 -24
  256. package/dist/type-CAteiET0.js +0 -42007
  257. package/dist/vocab/actor.test.d.ts +0 -3
  258. package/dist/vocab/actor.test.js +0 -5965
  259. package/dist/vocab/lookup.test.d.ts +0 -3
  260. package/dist/vocab/lookup.test.js +0 -206
  261. package/dist/vocab/mod.d.ts +0 -8
  262. package/dist/vocab/mod.js +0 -10
  263. package/dist/vocab/schema.yaml +0 -247
  264. package/dist/vocab/type.test.d.ts +0 -3
  265. package/dist/vocab/type.test.js +0 -25
  266. package/dist/vocab/vocab.test.d.ts +0 -3
  267. package/dist/vocab/vocab.test.js +0 -3363
  268. package/dist/vocab-89qErSc9.js +0 -246
  269. package/dist/vocab-SOE1ifCr.d.ts +0 -14634
  270. package/dist/webfinger/handler.test.d.ts +0 -3
  271. package/dist/webfinger/lookup.test.d.ts +0 -3
  272. package/dist/webfinger/lookup.test.js +0 -195
  273. package/dist/webfinger/mod.d.ts +0 -6
  274. package/dist/webfinger/mod.js +0 -9
  275. package/dist/webfinger-C3GIyXIg.js +0 -4
  276. package/dist/x/cfworkers.d.ts +0 -61
  277. package/dist/x/cfworkers.js +0 -98
  278. package/dist/x/cfworkers.test.d.ts +0 -3
  279. package/dist/x/cfworkers.test.js +0 -179
  280. package/dist/x/hono.d.ts +0 -56
  281. package/dist/x/hono.js +0 -60
  282. package/dist/x/sveltekit.d.ts +0 -48
  283. package/dist/x/sveltekit.js +0 -68
  284. /package/dist/{runtime/authdocloader.test.d.ts → federation/idempotency.test.d.ts} +0 -0
  285. /package/dist/{runtime/docloader.test.d.ts → federation/negotiation.test.d.ts} +0 -0
  286. /package/dist/{runtime/key.test.d.ts → federation/webfinger.test.d.ts} +0 -0
  287. /package/dist/{mod-1pDWKvUL.d.ts → mod-1E3W847c.d.ts} +0 -0
  288. /package/dist/{runtime/langstr.test.d.ts → otel/exporter.test.d.ts} +0 -0
  289. /package/dist/{retry-CfF8Gn4d.js → retry-D4GJ670a.js} +0 -0
  290. /package/dist/{types-BSuWJsOm.js → types-BEdCLHqP.js} +0 -0
  291. /package/dist/{testing → utils}/docloader.test.d.ts +0 -0
  292. /package/dist/{runtime/multibase/multibase.test.d.ts → utils/kv-cache.test.d.ts} +0 -0
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright 2024–2025 Hong Minhee
3
+ Copyright 2024–2026 Hong Minhee
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy of
6
6
  this software and associated documentation files (the "Software"), to deal in
package/README.md CHANGED
@@ -1,8 +1,7 @@
1
1
  <!-- deno-fmt-ignore-file -->
2
2
 
3
- ![](./logo.svg)
4
- Fedify: an ActivityPub server framework
5
- =======================================
3
+ ![](./logo.svg) Fedify: an ActivityPub server framework
4
+ =======================================================
6
5
 
7
6
  [![JSR][JSR badge]][JSR]
8
7
  [![npm][npm badge]][npm]
@@ -37,12 +36,12 @@ Currently, Fedify provides the following features out of the box:
37
36
  If you want to know more about the project, please take a look at the following
38
37
  resources:
39
38
 
40
- - [Installation](https://fedify.dev/install)
39
+ - [Installation]
41
40
  - Tutorials:
42
- [Learning the basics](https://fedify.dev/tutorial/basics) &
43
- [Creating a microblog](https://fedify.dev/tutorial/microblog)
41
+ [Learning the basics] &
42
+ [Creating a microblog]
44
43
  - [API reference][JSR]
45
- - [Examples](https://github.com/fedify-dev/fedify/tree/main/examples)
44
+ - [Examples]
46
45
 
47
46
  If you have any questions, suggestions, or feedback, please feel free to
48
47
  join our [Matrix chat space][Matrix] or [Discord server][Discord] or
@@ -51,16 +50,16 @@ join our [Matrix chat space][Matrix] or [Discord server][Discord] or
51
50
  [^1]: You may already know some of the networks in the fediverse, such as
52
51
  [Mastodon], [Lemmy], [Pixelfed], [PeerTube], and so on.
53
52
 
54
- [JSR]: https://jsr.io/@fedify/fedify
55
53
  [JSR badge]: https://jsr.io/badges/@fedify/fedify
56
- [npm]: https://www.npmjs.com/package/@fedify/fedify
54
+ [JSR]: https://jsr.io/@fedify/fedify
57
55
  [npm badge]: https://img.shields.io/npm/v/@fedify/fedify?logo=npm
58
- [GitHub Actions]: https://github.com/fedify-dev/fedify/actions/workflows/build.yaml
56
+ [npm]: https://www.npmjs.com/package/@fedify/fedify
59
57
  [GitHub Actions badge]: https://github.com/fedify-dev/fedify/actions/workflows/build.yaml/badge.svg
60
- [Matrix]: https://matrix.to/#/#fedify:matrix.org
58
+ [GitHub Actions]: https://github.com/fedify-dev/fedify/actions/workflows/build.yaml
61
59
  [Matrix badge]: https://img.shields.io/matrix/fedify%3Amatrix.org?logo=matrix
62
- [Discord]: https://discord.gg/bhtwpzURwd
60
+ [Matrix]: https://matrix.to/#/#fedify:matrix.org
63
61
  [Discord badge]: https://img.shields.io/discord/1295652627505217647?logo=discord&cacheSeconds=60
62
+ [Discord]: https://discord.gg/bhtwpzURwd
64
63
  [@fedify@hollo.social badge]: https://fedi-badge.deno.dev/@fedify@hollo.social/followers.svg
65
64
  [@fedify@hollo.social]: https://hollo.social/@fedify
66
65
  [Fedify Demo]: https://dash.deno.com/playground/fedify-demo
@@ -73,8 +72,13 @@ join our [Matrix chat space][Matrix] or [Discord server][Discord] or
73
72
  [FEP-8b32]: https://w3id.org/fep/8b32
74
73
  [Linked Data Signatures]: https://web.archive.org/web/20170923124140/https://w3c-dvcg.github.io/ld-signatures/
75
74
  [NodeInfo]: https://nodeinfo.diaspora.software/
75
+ [Installation]: https://fedify.dev/install
76
+ [Learning the basics]: https://fedify.dev/tutorial/basics
77
+ [Creating a microblog]: https://fedify.dev/tutorial/microblog
78
+ [Examples]: https://github.com/fedify-dev/fedify/tree/main/examples
76
79
  [GitHub Discussions]: https://github.com/fedify-dev/fedify/discussions
77
80
  [#Fedify]: https://mastodon.social/tags/fedify
81
+
78
82
  [Mastodon]: https://joinmastodon.org/
79
83
  [Lemmy]: https://join-lemmy.org/
80
84
  [Pixelfed]: https://pixelfed.org/
@@ -90,24 +94,33 @@ which provides the core functionality of the framework. Other packages provide
90
94
  integrations with various web frameworks, database drivers, and other features.
91
95
  Here is the list of packages:
92
96
 
93
- | Package | JSR | npm | Description |
94
- | --------------------------------------- | ---------------------------- | ---------------------------- | --------------------------------------- |
95
- | [@fedify/fedify](/packages/fedify/) | [JSR] | [npm] | The core framework of Fedify |
96
- | [@fedify/cli](/packages/cli/) | [JSR][jsr:@fedify/cli] | [npm][npm:@fedify/cli] | CLI toolchain for testing and debugging |
97
- | [@fedify/amqp](/packages/amqp/) | [JSR][jsr:@fedify/amqp] | [npm][npm:@fedify/amqp] | AMQP/RabbitMQ driver |
98
- | [@fedify/cfworkers](/packages/cfworkers/) | [JSR][jsr:@fedify/cfworkers] | [npm][npm:@fedify/cfworkers] | Cloudflare Workers integration |
99
- | [@fedify/denokv](/packages/denokv/) | [JSR][jsr:@fedify/denokv] | | Deno KV integration |
100
- | [@fedify/elysia](/packages/elysia/) | | [npm][npm:@fedify/elysia] | Elysia integration |
101
- | [@fedify/express](/packages/express/) | [JSR][jsr:@fedify/express] | [npm][npm:@fedify/express] | Express integration |
102
- | [@fedify/h3](/packages/h3/) | [JSR][jsr:@fedify/h3] | [npm][npm:@fedify/h3] | H3 integration |
103
- | [@fedify/hono](/packages/hono/) | [JSR][jsr:@fedify/hono] | [npm][npm:@fedify/hono] | Hono integration |
104
- | [@fedify/nestjs](/packages/nestjs/) | | [npm][npm:@fedify/nestjs] | NestJS integration |
105
- | [@fedify/next](/packages/next/) | | [npm][npm:@fedify/next] | Next.js integration |
106
- | [@fedify/postgres](/packages/postgres/) | [JSR][jsr:@fedify/postgres] | [npm][npm:@fedify/postgres] | PostgreSQL driver |
107
- | [@fedify/redis](/packages/redis/) | [JSR][jsr:@fedify/redis] | [npm][npm:@fedify/redis] | Redis driver |
108
- | [@fedify/sqlite](/packages/sqlite/) | [JSR][jsr:@fedify/sqlite] | [npm][npm:@fedify/sqlite] | SQLite driver |
109
- | [@fedify/sveltekit](/packages/sveltekit/) | [JSR][jsr:@fedify/sveltekit] | [npm][npm:@fedify/sveltekit] | SvelteKit integration |
110
- | [@fedify/testing](/packages/testing/) | [JSR][jsr:@fedify/testing] | [npm][npm:@fedify/testing] | Testing utilities |
97
+ | Package | JSR | npm | Description |
98
+ | ------------------------------------------------- | -------------------------------- | -------------------------------- | ---------------------------------------- |
99
+ | [@fedify/fedify](/packages/fedify/) | [JSR] | [npm] | The core framework of Fedify |
100
+ | [@fedify/cli](/packages/cli/) | [JSR][jsr:@fedify/cli] | [npm][npm:@fedify/cli] | CLI toolchain for testing and debugging |
101
+ | [@fedify/amqp](/packages/amqp/) | [JSR][jsr:@fedify/amqp] | [npm][npm:@fedify/amqp] | AMQP/RabbitMQ driver |
102
+ | [@fedify/cfworkers](/packages/cfworkers/) | [JSR][jsr:@fedify/cfworkers] | [npm][npm:@fedify/cfworkers] | Cloudflare Workers integration |
103
+ | [@fedify/denokv](/packages/denokv/) | [JSR][jsr:@fedify/denokv] | | Deno KV integration |
104
+ | [@fedify/elysia](/packages/elysia/) | | [npm][npm:@fedify/elysia] | Elysia integration |
105
+ | [@fedify/express](/packages/express/) | [JSR][jsr:@fedify/express] | [npm][npm:@fedify/express] | Express integration |
106
+ | [@fedify/fastify](/packages/fastify/) | [JSR][jsr:@fedify/fastify] | [npm][npm:@fedify/fastify] | Fastify integration |
107
+ | [@fedify/fresh](/packages/fresh/) | [JSR][jsr:@fedify/fresh] | | Fresh integration |
108
+ | [@fedify/h3](/packages/h3/) | [JSR][jsr:@fedify/h3] | [npm][npm:@fedify/h3] | H3 integration |
109
+ | [@fedify/hono](/packages/hono/) | [JSR][jsr:@fedify/hono] | [npm][npm:@fedify/hono] | Hono integration |
110
+ | [@fedify/koa](/packages/koa/) | [JSR][jsr:@fedify/koa] | [npm][npm:@fedify/koa] | Koa integration |
111
+ | [@fedify/lint](/packages/lint/) | [JSR][jsr:@fedify/lint] | [npm][npm:@fedify/lint] | Linting utilities |
112
+ | [@fedify/nestjs](/packages/nestjs/) | | [npm][npm:@fedify/nestjs] | NestJS integration |
113
+ | [@fedify/next](/packages/next/) | | [npm][npm:@fedify/next] | Next.js integration |
114
+ | [@fedify/postgres](/packages/postgres/) | [JSR][jsr:@fedify/postgres] | [npm][npm:@fedify/postgres] | PostgreSQL driver |
115
+ | [@fedify/redis](/packages/redis/) | [JSR][jsr:@fedify/redis] | [npm][npm:@fedify/redis] | Redis driver |
116
+ | [@fedify/relay](/packages/relay/) | [JSR][jsr:@fedify/relay] | [npm][npm:@fedify/relay] | ActivityPub relay support |
117
+ | [@fedify/sqlite](/packages/sqlite/) | [JSR][jsr:@fedify/sqlite] | [npm][npm:@fedify/sqlite] | SQLite driver |
118
+ | [@fedify/sveltekit](/packages/sveltekit/) | [JSR][jsr:@fedify/sveltekit] | [npm][npm:@fedify/sveltekit] | SvelteKit integration |
119
+ | [@fedify/testing](/packages/testing/) | [JSR][jsr:@fedify/testing] | [npm][npm:@fedify/testing] | Testing utilities |
120
+ | [@fedify/vocab](/packages/vocab/) | [JSR][jsr:@fedify/vocab] | [npm][npm:@fedify/vocab] | Activity Vocabulary library |
121
+ | [@fedify/vocab-runtime](/packages/vocab-runtime/) | [JSR][jsr:@fedify/vocab-runtime] | [npm][npm:@fedify/vocab-runtime] | Runtime library for code-generated vocab |
122
+ | [@fedify/vocab-tools](/packages/vocab-tools/) | [JSR][jsr:@fedify/vocab-tools] | [npm][npm:@fedify/vocab-tools] | Code generation tools for Activity Vocab |
123
+ | [@fedify/webfinger](/packages/webfinger/) | [JSR][jsr:@fedify/webfinger] | [npm][npm:@fedify/webfinger] | WebFinger client library for ActivityPub |
111
124
 
112
125
  [jsr:@fedify/cli]: https://jsr.io/@fedify/cli
113
126
  [npm:@fedify/cli]: https://www.npmjs.com/package/@fedify/cli
@@ -119,22 +132,39 @@ Here is the list of packages:
119
132
  [npm:@fedify/elysia]: https://www.npmjs.com/package/@fedify/elysia
120
133
  [jsr:@fedify/express]: https://jsr.io/@fedify/express
121
134
  [npm:@fedify/express]: https://www.npmjs.com/package/@fedify/express
135
+ [jsr:@fedify/fastify]: https://jsr.io/@fedify/fastify
136
+ [npm:@fedify/fastify]: https://www.npmjs.com/package/@fedify/fastify
137
+ [jsr:@fedify/fresh]: https://jsr.io/@fedify/fresh
122
138
  [jsr:@fedify/h3]: https://jsr.io/@fedify/h3
123
139
  [npm:@fedify/h3]: https://www.npmjs.com/package/@fedify/h3
124
140
  [jsr:@fedify/hono]: https://jsr.io/@fedify/hono
125
141
  [npm:@fedify/hono]: https://www.npmjs.com/package/@fedify/hono
142
+ [jsr:@fedify/koa]: https://jsr.io/@fedify/koa
143
+ [npm:@fedify/koa]: https://www.npmjs.com/package/@fedify/koa
144
+ [jsr:@fedify/lint]: https://jsr.io/@fedify/lint
145
+ [npm:@fedify/lint]: https://www.npmjs.com/package/@fedify/lint
126
146
  [npm:@fedify/nestjs]: https://www.npmjs.com/package/@fedify/nestjs
127
147
  [npm:@fedify/next]: https://www.npmjs.com/package/@fedify/next
128
148
  [jsr:@fedify/postgres]: https://jsr.io/@fedify/postgres
129
149
  [npm:@fedify/postgres]: https://www.npmjs.com/package/@fedify/postgres
130
150
  [jsr:@fedify/redis]: https://jsr.io/@fedify/redis
131
151
  [npm:@fedify/redis]: https://www.npmjs.com/package/@fedify/redis
152
+ [jsr:@fedify/relay]: https://jsr.io/@fedify/relay
153
+ [npm:@fedify/relay]: https://www.npmjs.com/package/@fedify/relay
132
154
  [jsr:@fedify/sqlite]: https://jsr.io/@fedify/sqlite
133
155
  [npm:@fedify/sqlite]: https://www.npmjs.com/package/@fedify/sqlite
134
156
  [jsr:@fedify/sveltekit]: https://jsr.io/@fedify/sveltekit
135
157
  [npm:@fedify/sveltekit]: https://www.npmjs.com/package/@fedify/sveltekit
136
158
  [jsr:@fedify/testing]: https://jsr.io/@fedify/testing
137
159
  [npm:@fedify/testing]: https://www.npmjs.com/package/@fedify/testing
160
+ [jsr:@fedify/vocab]: https://jsr.io/@fedify/vocab
161
+ [npm:@fedify/vocab]: https://www.npmjs.com/package/@fedify/vocab
162
+ [jsr:@fedify/vocab-runtime]: https://jsr.io/@fedify/vocab-runtime
163
+ [npm:@fedify/vocab-runtime]: https://www.npmjs.com/package/@fedify/vocab-runtime
164
+ [jsr:@fedify/vocab-tools]: https://jsr.io/@fedify/vocab-tools
165
+ [npm:@fedify/vocab-tools]: https://www.npmjs.com/package/@fedify/vocab-tools
166
+ [jsr:@fedify/webfinger]: https://jsr.io/@fedify/webfinger
167
+ [npm:@fedify/webfinger]: https://www.npmjs.com/package/@fedify/webfinger
138
168
 
139
169
 
140
170
  Sponsors
@@ -146,7 +176,10 @@ financial contributors:[^2]
146
176
 
147
177
  [^2]: Those lists are automatically updated every hour.
148
178
 
179
+ <!-- hongdown-disable -->
180
+
149
181
  <!-- cSpell: disable -->
182
+
150
183
  <!-- DO NOT EDIT(h3): this section is automatically generated by the script -->
151
184
 
152
185
  ### Corporate sponsors
@@ -169,8 +202,11 @@ Robin Riley, yamanoku, Encyclia, taye, okin, Andy Piper, box464, Evan Prodromou,
169
202
  Robin Riley, Markus P, Nils Bergmann, Rameez
170
203
 
171
204
  <!-- /DO NOT EDIT -->
205
+
172
206
  <!-- cSpell: enable -->
173
207
 
208
+ <!-- hongdown-enable -->
209
+
174
210
  ### Become a sponsor
175
211
 
176
212
  We welcome financial contributions to help us maintain and improve this project.
@@ -4,7 +4,7 @@
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
6
  import { AssertionError } from "./assert_equals-DSbWqCm3.js";
7
- import { assertIsError } from "./assert_is_error-B035L3om.js";
7
+ import { assertIsError } from "./assert_throws-BNXdRGWP.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
  /**
@@ -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,10 +3,11 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { deno_default, getTypeId } from "./type-CAteiET0.js";
7
- import { Router, RouterError } from "./lookup-DuzrBbTj.js";
8
- import { InboxListenerSet } from "./inbox-DoJlwIE4.js";
6
+ import { deno_default } from "./deno-DIwNGswC.js";
7
+ import { Router, RouterError } from "./router-D9eI0s4b.js";
8
+ import { InboxListenerSet } from "./inbox-DCV2fS3F.js";
9
9
  import { getLogger } from "@logtape/logtape";
10
+ import { getTypeId } from "@fedify/vocab";
10
11
  import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
11
12
 
12
13
  //#region src/federation/builder.ts
@@ -28,6 +29,7 @@ var FederationBuilderImpl = class {
28
29
  inboxListeners;
29
30
  inboxErrorHandler;
30
31
  sharedInboxKeyDispatcher;
32
+ idempotencyStrategy;
31
33
  collectionTypeIds;
32
34
  collectionCallbacks;
33
35
  /**
@@ -42,7 +44,7 @@ var FederationBuilderImpl = class {
42
44
  this.collectionTypeIds = {};
43
45
  }
44
46
  async build(options) {
45
- const { FederationImpl } = await import("./middleware-CNfiKLIZ.js");
47
+ const { FederationImpl } = await import("./middleware-CYlahvpt.js");
46
48
  const f = new FederationImpl(options);
47
49
  const trailingSlashInsensitiveValue = f.router.trailingSlashInsensitive;
48
50
  f.router = this.router.clone();
@@ -64,6 +66,7 @@ var FederationBuilderImpl = class {
64
66
  f.inboxListeners = this.inboxListeners?.clone();
65
67
  f.inboxErrorHandler = this.inboxErrorHandler;
66
68
  f.sharedInboxKeyDispatcher = this.sharedInboxKeyDispatcher;
69
+ f.idempotencyStrategy = this.idempotencyStrategy;
67
70
  return f;
68
71
  }
69
72
  _getTracer() {
@@ -486,15 +489,19 @@ var FederationBuilderImpl = class {
486
489
  setSharedKeyDispatcher: (dispatcher) => {
487
490
  this.sharedInboxKeyDispatcher = dispatcher;
488
491
  return setters;
492
+ },
493
+ withIdempotency: (strategy) => {
494
+ this.idempotencyStrategy = strategy;
495
+ return setters;
489
496
  }
490
497
  };
491
498
  return setters;
492
499
  }
493
- setCollectionDispatcher(name, ...args) {
494
- return this.#setCustomCollectionDispatcher(name, "collection", ...args);
500
+ setCollectionDispatcher(name, itemType, path, dispatcher) {
501
+ return this.#setCustomCollectionDispatcher(name, "collection", itemType, path, dispatcher);
495
502
  }
496
- setOrderedCollectionDispatcher(name, ...args) {
497
- return this.#setCustomCollectionDispatcher(name, "orderedCollection", ...args);
503
+ setOrderedCollectionDispatcher(name, itemType, path, dispatcher) {
504
+ return this.#setCustomCollectionDispatcher(name, "orderedCollection", itemType, path, dispatcher);
498
505
  }
499
506
  #setCustomCollectionDispatcher(name, collectionType, itemType, path, dispatcher) {
500
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,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 };
@@ -1,6 +1,6 @@
1
1
  import { Temporal } from "@js-temporal/polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
- import { GetUserAgentOptions } from "./docloader-CxWcuWqQ.js";
3
+ import { GetUserAgentOptions } from "@fedify/vocab-runtime";
4
4
 
5
5
  //#region src/nodeinfo/types.d.ts
6
6
  /**
@@ -3,8 +3,8 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { getUserAgent } from "./type-CAteiET0.js";
7
6
  import { getLogger } from "@logtape/logtape";
7
+ import { getUserAgent } from "@fedify/vocab-runtime";
8
8
 
9
9
  //#region src/nodeinfo/client.ts
10
10
  const logger = getLogger([
@@ -0,0 +1,10 @@
1
+
2
+ const { Temporal } = require("@js-temporal/polyfill");
3
+ const { URLPattern } = require("urlpattern-polyfill");
4
+
5
+ const require_transformers = require('../transformers-BjBg6Lag.cjs');
6
+ require('../compat-DmDDELst.cjs');
7
+
8
+ exports.actorDehydrator = require_transformers.actorDehydrator;
9
+ exports.autoIdAssigner = require_transformers.autoIdAssigner;
10
+ exports.getDefaultActivityTransformers = require_transformers.getDefaultActivityTransformers;
@@ -0,0 +1,7 @@
1
+ import "../client-94iWEfQa.cjs";
2
+ import "../http-ClB3pLcL.cjs";
3
+ import "../owner-C-zfmVAD.cjs";
4
+ import { ActivityTransformer } from "../context-D2MrtLch.cjs";
5
+ import "../kv-D8q9fLkA.cjs";
6
+ import { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers } from "../mod-CNNTHyBC.cjs";
7
+ export { ActivityTransformer, actorDehydrator, autoIdAssigner, getDefaultActivityTransformers };
@@ -1,15 +1,9 @@
1
1
  import { Temporal } from "@js-temporal/polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
- import "../kv-C7sopW2E.js";
4
- import "../docloader-CxWcuWqQ.js";
5
- import "../client-bgSdkFa2.js";
6
- import "../vocab-SOE1ifCr.js";
7
- import "../actor-C22bXuuC.js";
8
- import "../http-DqSNLFNY.js";
9
- import "../owner-CQPnQVtf.js";
10
- import "../mod-Cxt4Kpf6.js";
11
- import "../mod-DBzN0aCM.js";
12
- import { ActivityTransformer } from "../context-CDSZdQHD.js";
13
- import "../mq-CRGm1e_F.js";
14
- import { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers } from "../mod-RI3-KvUI.js";
3
+ import "../client-BivSNrEg.js";
4
+ import "../http-DLBDPal9.js";
5
+ import "../owner-BgI8C-VY.js";
6
+ import { ActivityTransformer } from "../context-CYZ2i00R.js";
7
+ import "../kv-CtOmTRNc.js";
8
+ import { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers } from "../mod-D_cmv2il.js";
15
9
  export { ActivityTransformer, actorDehydrator, autoIdAssigner, getDefaultActivityTransformers };
@@ -1,8 +1,8 @@
1
1
 
2
- import { Temporal } from "@js-temporal/polyfill";
3
- import { URLPattern } from "urlpattern-polyfill";
4
-
5
- import { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers } from "../transformers-Dna8Fg7k.js";
6
- import "../compat-Bb5myD13.js";
2
+ import { Temporal } from "@js-temporal/polyfill";
3
+ import { URLPattern } from "urlpattern-polyfill";
4
+
5
+ import { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers } from "../transformers-N_ip_y4P.js";
6
+ import "../compat-nxUqe4Z-.js";
7
7
 
8
8
  export { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers };