@fedify/fedify 2.0.0-dev.1690 → 2.0.0-dev.170

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 (317) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +70 -34
  3. package/dist/{assert_rejects-DiIiJbZn.js → assert_rejects-Ce45JcFg.js} +1 -1
  4. package/dist/{assert_is_error-BPGph1Jx.js → assert_throws-BNXdRGWP.js} +31 -1
  5. package/dist/{builder-CYOcDUkj.js → builder-_MVsWtsS.js} +9 -8
  6. package/dist/{client-bgSdkFa2.d.ts → client-CUTUGgvJ.d.ts} +19 -19
  7. package/dist/{client-CnOdwLLN.js → client-Dg7OfUDA.js} +28 -23
  8. package/dist/{client-CegPX0Rn.d.cts → client-by-PEGAJ.d.cts} +19 -19
  9. package/dist/compat/mod.cjs +1 -1
  10. package/dist/compat/mod.d.cts +6 -12
  11. package/dist/compat/mod.d.ts +6 -12
  12. package/dist/compat/mod.js +1 -1
  13. package/dist/compat/transformers.test.js +19 -18
  14. package/dist/context-Bns6uTJq.js +109 -0
  15. package/dist/{context-ByZprN0S.d.ts → context-C7vzWilY.d.ts} +314 -182
  16. package/dist/{context-C5BsZkDr.d.cts → context-CrB9RFy5.d.cts} +314 -182
  17. package/dist/deno-DhWON59o.js +117 -0
  18. package/dist/{testing-BWNCAbL-.js → dist-B5f6a8Tt.js} +90 -111
  19. package/dist/{authdocloader-Brax1A32.js → docloader-Cni79dmb.js} +17 -8
  20. package/dist/{esm-DnIzfEj0.js → esm-DGl7uK1r.js} +32 -17
  21. package/dist/federation/builder.test.js +11 -11
  22. package/dist/federation/collection.test.js +5 -8
  23. package/dist/federation/handler.test.js +111 -24
  24. package/dist/federation/idempotency.test.js +24 -24
  25. package/dist/federation/inbox.test.js +5 -6
  26. package/dist/federation/keycache.test.js +4 -5
  27. package/dist/federation/kv.test.js +60 -9
  28. package/dist/federation/middleware.test.js +102 -101
  29. package/dist/federation/mod.cjs +8 -12
  30. package/dist/federation/mod.d.cts +7 -13
  31. package/dist/federation/mod.d.ts +7 -13
  32. package/dist/federation/mod.js +8 -13
  33. package/dist/federation/mq.test.js +9 -10
  34. package/dist/federation/negotiation.test.js +5 -8
  35. package/dist/federation/retry.test.js +2 -4
  36. package/dist/federation/router.test.js +6 -8
  37. package/dist/federation/send.test.js +55 -15
  38. package/dist/{webfinger/handler.test.js → federation/webfinger.test.js} +25 -24
  39. package/dist/{federation-H2_En3j5.cjs → federation-B431K2gm.cjs} +22 -0
  40. package/dist/{federation-D1U8YY9t.js → federation-BbZwNNWj.js} +28 -6
  41. package/dist/{http-C7vbQwbz.cjs → http-7RQPvAkX.cjs} +410 -14
  42. package/dist/{http-BxbM8sEy.js → http-CZXlv4xU.js} +371 -11
  43. package/dist/{http-D-e6AFwR.d.cts → http-ClB3pLcL.d.cts} +2 -2
  44. package/dist/{http-BNOYnVsU.js → http-CwsBL5_A.js} +3 -2
  45. package/dist/{http-D6Uj2x2y.d.ts → http-DLBDPal9.d.ts} +2 -2
  46. package/dist/{inbox-BRru9pX3.js → inbox-CukSCwad.js} +2 -1
  47. package/dist/{key-1KXru8Ug.js → key-DKkHKzvg.js} +3 -2
  48. package/dist/{keycache-CN61iGVj.js → keycache-DRxpZ5r9.js} +1 -1
  49. package/dist/{keys-BPdFKgiy.js → keys-ZbcByPg9.js} +2 -1
  50. package/dist/{kv-63Cil1MD.d.cts → kv-B4vFhIYL.d.cts} +30 -1
  51. package/dist/{kv-C7sopW2E.d.ts → kv-CYySNrsn.d.ts} +30 -1
  52. package/dist/{kv-CRZrzyXm.js → kv-QzKcOQgP.js} +22 -0
  53. package/dist/kv-cache-BEeqyGER.js +107 -0
  54. package/dist/kv-cache-BVA7CrnS.cjs +134 -0
  55. package/dist/kv-cache-HDuc4ZaJ.js +122 -0
  56. package/dist/{ld-Dv8DNNAT.js → ld-CM6OO5ar.js} +4 -2
  57. package/dist/middleware--i9t8nKh.js +26 -0
  58. package/dist/middleware-C567nJlD.cjs +12 -0
  59. package/dist/middleware-D9oWuacw.js +12 -0
  60. package/dist/{middleware-DY9B2lL8.js → middleware-DXRcwk_y.js} +185 -192
  61. package/dist/{middleware-BmoOlgc1.cjs → middleware-TufpQUzj.cjs} +251 -241
  62. package/dist/{middleware-Bz_A2jeJ.js → middleware-eDeNdyRA.js} +195 -191
  63. package/dist/mod-0p9zUdzg.d.cts +107 -0
  64. package/dist/mod-0qnPv4EC.d.cts +62 -0
  65. package/dist/{mod-Djzcw2ry.d.cts → mod-BrS8tiad.d.cts} +3 -3
  66. package/dist/mod-C3SOvTD1.d.ts +64 -0
  67. package/dist/{mod-8DMWKtQE.d.cts → mod-D6pS5_xJ.d.cts} +4 -4
  68. package/dist/{mod-BhUKmBJD.d.ts → mod-jOa7W503.d.ts} +3 -3
  69. package/dist/{mod-D6hQoxC5.d.ts → mod-waqu-BL_.d.ts} +4 -4
  70. package/dist/mod-xc20HhMD.d.ts +109 -0
  71. package/dist/mod.cjs +17 -112
  72. package/dist/mod.d.cts +11 -17
  73. package/dist/mod.d.ts +11 -17
  74. package/dist/mod.js +11 -17
  75. package/dist/nodeinfo/client.test.js +7 -10
  76. package/dist/nodeinfo/handler.test.js +23 -23
  77. package/dist/nodeinfo/mod.cjs +2 -3
  78. package/dist/nodeinfo/mod.d.cts +2 -4
  79. package/dist/nodeinfo/mod.d.ts +2 -4
  80. package/dist/nodeinfo/mod.js +2 -3
  81. package/dist/nodeinfo/types.test.js +6 -9
  82. package/dist/otel/exporter.test.js +893 -0
  83. package/dist/otel/mod.cjs +256 -0
  84. package/dist/otel/mod.d.cts +230 -0
  85. package/dist/otel/mod.d.ts +232 -0
  86. package/dist/otel/mod.js +255 -0
  87. package/dist/{owner-e3FYDhsk.js → owner-BOEfZQv2.js} +45 -8
  88. package/dist/{owner-hd9lvQcP.d.ts → owner-BgI8C-VY.d.ts} +2 -3
  89. package/dist/{owner-BN_tO3cY.d.cts → owner-C-zfmVAD.d.cts} +2 -3
  90. package/dist/{proof-B-eqv0Ug.cjs → proof-CaDQpGJD.cjs} +69 -33
  91. package/dist/{proof-DfgvA3al.js → proof-iYIDiv8I.js} +47 -11
  92. package/dist/{proof-6gFMwMNJ.js → proof-iw6KtIyj.js} +3 -2
  93. package/dist/router-D9eI0s4b.js +118 -0
  94. package/dist/{send-Tl9NOnmO.js → send-Bn8o0mjW.js} +9 -4
  95. package/dist/sig/http.test.js +11 -13
  96. package/dist/sig/key.test.js +9 -11
  97. package/dist/sig/ld.test.js +8 -10
  98. package/dist/sig/mod.cjs +7 -11
  99. package/dist/sig/mod.d.cts +3 -7
  100. package/dist/sig/mod.d.ts +3 -7
  101. package/dist/sig/mod.js +3 -7
  102. package/dist/sig/owner.test.js +33 -12
  103. package/dist/sig/proof.test.js +13 -14
  104. package/dist/testing/mod.d.ts +183 -7194
  105. package/dist/testing/mod.js +4 -4
  106. package/dist/{transformers-CoBS-oFG.cjs → transformers-BjBg6Lag.cjs} +2 -2
  107. package/dist/{transformers-BFT6d7J5.js → transformers-N_ip_y4P.js} +2 -2
  108. package/dist/{types-DqxyTxOf.js → types-8l28uC8o.js} +31 -26
  109. package/dist/{types-zqdWZh4O.cjs → types-B6z6CqIz.cjs} +33 -28
  110. package/dist/{types-BSuWJsOm.js → types-CPz01LGH.js} +3 -3
  111. package/dist/{runtime/authdocloader.test.js → utils/docloader.test.js} +13 -15
  112. package/dist/utils/kv-cache.test.js +211 -0
  113. package/dist/utils/mod.cjs +10 -0
  114. package/dist/utils/mod.d.cts +4 -0
  115. package/dist/utils/mod.d.ts +6 -0
  116. package/dist/utils/mod.js +9 -0
  117. package/package.json +34 -75
  118. package/dist/actor-Be0ThtXy.cjs +0 -42609
  119. package/dist/actor-ChbPLm6n.js +0 -42135
  120. package/dist/actor-D6K058Tb.d.cts +0 -128
  121. package/dist/actor-DuCeRiNh.js +0 -146
  122. package/dist/actor-T6RyhRgk.d.ts +0 -130
  123. package/dist/assert_throws-BOO88avQ.js +0 -39
  124. package/dist/authdocloader-CrxhFL8e.js +0 -52
  125. package/dist/authdocloader-OSn_teLV.cjs +0 -58
  126. package/dist/denokv-Bv33Xxea.js +0 -57
  127. package/dist/docloader-CCqXeagZ.cjs +0 -4861
  128. package/dist/docloader-CxWcuWqQ.d.ts +0 -221
  129. package/dist/docloader-D-MrRyHl.d.cts +0 -219
  130. package/dist/docloader-XK3y2jn5.js +0 -4795
  131. package/dist/fixtures/activitypub.academy/users/brauca_darradiul.json +0 -83
  132. package/dist/fixtures/example.com/announce.json +0 -6
  133. package/dist/fixtures/example.com/collection.json +0 -19
  134. package/dist/fixtures/example.com/create.json +0 -6
  135. package/dist/fixtures/example.com/cross-origin-actor.json +0 -6
  136. package/dist/fixtures/example.com/hong-gildong.json +0 -11
  137. package/dist/fixtures/example.com/invite.json +0 -7
  138. package/dist/fixtures/example.com/key.json +0 -7
  139. package/dist/fixtures/example.com/key2.json +0 -6
  140. package/dist/fixtures/example.com/object.json +0 -6
  141. package/dist/fixtures/example.com/orderedcollectionpage.json +0 -24
  142. package/dist/fixtures/example.com/paged/a.json +0 -13
  143. package/dist/fixtures/example.com/paged/b.json +0 -16
  144. package/dist/fixtures/example.com/paged-collection.json +0 -6
  145. package/dist/fixtures/example.com/person.json +0 -22
  146. package/dist/fixtures/example.com/person2.json +0 -40
  147. package/dist/fixtures/example.com/test.json +0 -5
  148. package/dist/fixtures/example.com/users/handle.json +0 -16
  149. package/dist/fixtures/example.com/wrong-type.json +0 -3
  150. package/dist/fixtures/media.example.com/avatars/test-avatar.jpg.json +0 -6
  151. package/dist/fixtures/oeee.cafe/ap/users/3609fd4e-d51d-4db8-9f04-4189815864dd.json +0 -24
  152. package/dist/fixtures/remote.domain/users/bob.json +0 -20
  153. package/dist/fixtures/server.example/users/alice.json +0 -20
  154. package/dist/fixtures/w3id.org/identity/v1.json +0 -152
  155. package/dist/fixtures/w3id.org/security/data-integrity/v1.json +0 -74
  156. package/dist/fixtures/w3id.org/security/multikey/v1.json +0 -35
  157. package/dist/fixtures/w3id.org/security/v1.json +0 -50
  158. package/dist/fixtures/wizard.casa/users/hongminhee.json +0 -69
  159. package/dist/fixtures/www.w3.org/ns/activitystreams.json +0 -379
  160. package/dist/fixtures/www.w3.org/ns/did/v1.json +0 -58
  161. package/dist/key-B3uag-rz.js +0 -10
  162. package/dist/key-BiBmb1Yy.cjs +0 -10
  163. package/dist/key-DK_nfU4I.js +0 -10
  164. package/dist/key-Z6ceKnZC.cjs +0 -290
  165. package/dist/key-jyNTxCvK.js +0 -260
  166. package/dist/lookup-BPviO8ij.js +0 -131
  167. package/dist/lookup-hnMAAU5r.cjs +0 -137
  168. package/dist/lookup-pV0JOsuV.js +0 -331
  169. package/dist/middleware-CI0-zw4U.js +0 -26
  170. package/dist/middleware-QNK-W-jE.cjs +0 -17
  171. package/dist/middleware-_vjt6FWU.js +0 -17
  172. package/dist/mod-CerN_Sza.d.ts +0 -104
  173. package/dist/mod-Cj1tHXBR.d.cts +0 -102
  174. package/dist/mod-CxkWO3Mg.d.cts +0 -307
  175. package/dist/mod-DBzN0aCM.d.ts +0 -115
  176. package/dist/mod-DlU8ISoa.d.ts +0 -309
  177. package/dist/mod-FZd39qVq.d.cts +0 -1
  178. package/dist/mod-g0xFzAP9.d.ts +0 -2
  179. package/dist/mod-jQ4OODsl.d.cts +0 -113
  180. package/dist/mq-B7R1Q-M5.d.cts +0 -140
  181. package/dist/mq-CRGm1e_F.d.ts +0 -143
  182. package/dist/runtime/docloader.test.js +0 -522
  183. package/dist/runtime/key.test.js +0 -103
  184. package/dist/runtime/langstr.test.d.ts +0 -3
  185. package/dist/runtime/langstr.test.js +0 -39
  186. package/dist/runtime/link.test.d.ts +0 -3
  187. package/dist/runtime/link.test.js +0 -61
  188. package/dist/runtime/mod.cjs +0 -25
  189. package/dist/runtime/mod.d.cts +0 -6
  190. package/dist/runtime/mod.d.ts +0 -8
  191. package/dist/runtime/mod.js +0 -13
  192. package/dist/runtime/multibase/multibase.test.d.ts +0 -3
  193. package/dist/runtime/multibase/multibase.test.js +0 -358
  194. package/dist/runtime/url.test.d.ts +0 -3
  195. package/dist/runtime/url.test.js +0 -45
  196. package/dist/src/vocab/accept.yaml +0 -15
  197. package/dist/src/vocab/activity.yaml +0 -98
  198. package/dist/src/vocab/add.yaml +0 -16
  199. package/dist/src/vocab/announce.yaml +0 -30
  200. package/dist/src/vocab/application.yaml +0 -324
  201. package/dist/src/vocab/arrive.yaml +0 -15
  202. package/dist/src/vocab/article.yaml +0 -46
  203. package/dist/src/vocab/audio.yaml +0 -11
  204. package/dist/src/vocab/block.yaml +0 -16
  205. package/dist/src/vocab/chatmessage.yaml +0 -50
  206. package/dist/src/vocab/collection.yaml +0 -154
  207. package/dist/src/vocab/collectionpage.yaml +0 -55
  208. package/dist/src/vocab/create.yaml +0 -28
  209. package/dist/src/vocab/dataintegrityproof.yaml +0 -56
  210. package/dist/src/vocab/delete.yaml +0 -27
  211. package/dist/src/vocab/didservice.yaml +0 -22
  212. package/dist/src/vocab/dislike.yaml +0 -14
  213. package/dist/src/vocab/document.yaml +0 -31
  214. package/dist/src/vocab/emoji.yaml +0 -12
  215. package/dist/src/vocab/emojireact.yaml +0 -17
  216. package/dist/src/vocab/endpoints.yaml +0 -85
  217. package/dist/src/vocab/event.yaml +0 -11
  218. package/dist/src/vocab/export.yaml +0 -9
  219. package/dist/src/vocab/flag.yaml +0 -15
  220. package/dist/src/vocab/follow.yaml +0 -19
  221. package/dist/src/vocab/group.yaml +0 -324
  222. package/dist/src/vocab/hashtag.yaml +0 -14
  223. package/dist/src/vocab/ignore.yaml +0 -14
  224. package/dist/src/vocab/image.yaml +0 -9
  225. package/dist/src/vocab/intransitiveactivity.yaml +0 -15
  226. package/dist/src/vocab/invite.yaml +0 -14
  227. package/dist/src/vocab/join.yaml +0 -14
  228. package/dist/src/vocab/key.yaml +0 -28
  229. package/dist/src/vocab/leave.yaml +0 -14
  230. package/dist/src/vocab/like.yaml +0 -16
  231. package/dist/src/vocab/link.yaml +0 -101
  232. package/dist/src/vocab/listen.yaml +0 -12
  233. package/dist/src/vocab/mention.yaml +0 -9
  234. package/dist/src/vocab/move.yaml +0 -15
  235. package/dist/src/vocab/multikey.yaml +0 -36
  236. package/dist/src/vocab/note.yaml +0 -48
  237. package/dist/src/vocab/object.yaml +0 -404
  238. package/dist/src/vocab/offer.yaml +0 -15
  239. package/dist/src/vocab/orderedcollection.yaml +0 -39
  240. package/dist/src/vocab/orderedcollectionpage.yaml +0 -50
  241. package/dist/src/vocab/organization.yaml +0 -324
  242. package/dist/src/vocab/page.yaml +0 -11
  243. package/dist/src/vocab/person.yaml +0 -324
  244. package/dist/src/vocab/place.yaml +0 -75
  245. package/dist/src/vocab/profile.yaml +0 -26
  246. package/dist/src/vocab/propertyvalue.yaml +0 -32
  247. package/dist/src/vocab/question.yaml +0 -103
  248. package/dist/src/vocab/read.yaml +0 -13
  249. package/dist/src/vocab/reject.yaml +0 -14
  250. package/dist/src/vocab/relationship.yaml +0 -52
  251. package/dist/src/vocab/remove.yaml +0 -14
  252. package/dist/src/vocab/service.yaml +0 -324
  253. package/dist/src/vocab/source.yaml +0 -26
  254. package/dist/src/vocab/tentativeaccept.yaml +0 -14
  255. package/dist/src/vocab/tentativereject.yaml +0 -14
  256. package/dist/src/vocab/tombstone.yaml +0 -24
  257. package/dist/src/vocab/travel.yaml +0 -16
  258. package/dist/src/vocab/undo.yaml +0 -26
  259. package/dist/src/vocab/update.yaml +0 -58
  260. package/dist/src/vocab/video.yaml +0 -11
  261. package/dist/src/vocab/view.yaml +0 -13
  262. package/dist/testing/docloader.test.js +0 -24
  263. package/dist/type-C69ZBu7f.js +0 -47010
  264. package/dist/vocab/actor.test.d.ts +0 -3
  265. package/dist/vocab/actor.test.js +0 -5965
  266. package/dist/vocab/lookup.test.d.ts +0 -3
  267. package/dist/vocab/lookup.test.js +0 -456
  268. package/dist/vocab/mod.cjs +0 -87
  269. package/dist/vocab/mod.d.cts +0 -6
  270. package/dist/vocab/mod.d.ts +0 -8
  271. package/dist/vocab/mod.js +0 -10
  272. package/dist/vocab/schema.yaml +0 -247
  273. package/dist/vocab/type.test.d.ts +0 -3
  274. package/dist/vocab/type.test.js +0 -25
  275. package/dist/vocab/vocab.test.d.ts +0 -3
  276. package/dist/vocab/vocab.test.js +0 -3787
  277. package/dist/vocab-B39-pFl9.cjs +0 -291
  278. package/dist/vocab-BI0Ak5lL.d.ts +0 -14924
  279. package/dist/vocab-BWoeZsME.js +0 -255
  280. package/dist/vocab-Dw1-yVGg.d.cts +0 -14922
  281. package/dist/webfinger/handler.test.d.ts +0 -3
  282. package/dist/webfinger/lookup.test.d.ts +0 -3
  283. package/dist/webfinger/lookup.test.js +0 -195
  284. package/dist/webfinger/mod.cjs +0 -9
  285. package/dist/webfinger/mod.d.cts +0 -4
  286. package/dist/webfinger/mod.d.ts +0 -6
  287. package/dist/webfinger/mod.js +0 -9
  288. package/dist/webfinger-BjOEdFPs.cjs +0 -4
  289. package/dist/webfinger-De_bU0iE.js +0 -4
  290. package/dist/x/cfworkers.cjs +0 -100
  291. package/dist/x/cfworkers.d.cts +0 -59
  292. package/dist/x/cfworkers.d.ts +0 -61
  293. package/dist/x/cfworkers.js +0 -98
  294. package/dist/x/cfworkers.test.d.ts +0 -3
  295. package/dist/x/cfworkers.test.js +0 -179
  296. package/dist/x/hono.cjs +0 -61
  297. package/dist/x/hono.d.cts +0 -54
  298. package/dist/x/hono.d.ts +0 -56
  299. package/dist/x/hono.js +0 -60
  300. package/dist/x/sveltekit.cjs +0 -69
  301. package/dist/x/sveltekit.d.cts +0 -46
  302. package/dist/x/sveltekit.d.ts +0 -48
  303. package/dist/x/sveltekit.js +0 -68
  304. /package/dist/{assert_not_equals-f3m3epl3.js → assert_not_equals-C80BG-_5.js} +0 -0
  305. /package/dist/{runtime/authdocloader.test.d.ts → federation/webfinger.test.d.ts} +0 -0
  306. /package/dist/{mod-1pDWKvUL.d.ts → mod-1E3W847c.d.ts} +0 -0
  307. /package/dist/{mod-C2tOeRkN.d.cts → mod-C81L6_lQ.d.cts} +0 -0
  308. /package/dist/{nodeinfo-DfycQ8Wf.js → nodeinfo-BlLsRSiT.js} +0 -0
  309. /package/dist/{nodeinfo-Co9lJrWl.cjs → nodeinfo-DuMYTpbZ.cjs} +0 -0
  310. /package/dist/{runtime/docloader.test.d.ts → otel/exporter.test.d.ts} +0 -0
  311. /package/dist/{runtime-DPYEDf-o.js → sig-CwuONEzF.js} +0 -0
  312. /package/dist/{runtime-C58AJWSv.cjs → sig-DeXX2xnj.cjs} +0 -0
  313. /package/dist/{std__assert-X-_kMxKM.js → std__assert-DWivtrGR.js} +0 -0
  314. /package/dist/{testing → utils}/docloader.test.d.ts +0 -0
  315. /package/dist/{runtime/key.test.d.ts → utils/kv-cache.test.d.ts} +0 -0
  316. /package/dist/{sig-ByHXzqUi.cjs → utils-Db0ZmjcD.cjs} +0 -0
  317. /package/dist/{sig-Cj3tk-ig.js → utils-Wranxuoe.js} +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]
@@ -16,7 +15,7 @@ Fedify: an ActivityPub server framework
16
15
 
17
16
  Fedify is a TypeScript library for building federated server apps
18
17
  powered by [ActivityPub] and other standards, so-called [fediverse].[^1]
19
- It aims to eliminate the complexity and redundant boilerplate code when
18
+ It aims to eliminate the complexity and boilerplate code when
20
19
  building a federated server app, so that you can focus on your business logic
21
20
  and user experience.
22
21
 
@@ -29,20 +28,20 @@ Currently, Fedify provides the following features out of the box:
29
28
  - [Object Integrity Proofs][FEP-8b32] & [Linked Data Signatures]
30
29
  - Middlewares for handling webhooks
31
30
  - [NodeInfo] protocol
32
- - Special touch for interoperability with Mastodon and few other popular
33
- fediverse software
31
+ - Enhanced interoperability with Mastodon and other popular fediverse
32
+ software
34
33
  - Integration with various web frameworks
35
34
  - CLI toolchain for testing and debugging
36
35
 
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/
@@ -85,29 +89,38 @@ Packages
85
89
  --------
86
90
 
87
91
  Fedify is a monorepo that contains several packages, each of which provides
88
- different features and functionalities. The main package is *@fedify/fedify*,
92
+ different features. The main package is *@fedify/fedify*,
89
93
  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-BPGph1Jx.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-C69ZBu7f.js";
7
- import { Router, RouterError } from "./lookup-pV0JOsuV.js";
8
- import { InboxListenerSet } from "./inbox-BRru9pX3.js";
6
+ import { deno_default } from "./deno-DhWON59o.js";
7
+ import { Router, RouterError } from "./router-D9eI0s4b.js";
8
+ import { InboxListenerSet } from "./inbox-CukSCwad.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
@@ -43,7 +44,7 @@ var FederationBuilderImpl = class {
43
44
  this.collectionTypeIds = {};
44
45
  }
45
46
  async build(options) {
46
- const { FederationImpl } = await import("./middleware-CI0-zw4U.js");
47
+ const { FederationImpl } = await import("./middleware--i9t8nKh.js");
47
48
  const f = new FederationImpl(options);
48
49
  const trailingSlashInsensitiveValue = f.router.trailingSlashInsensitive;
49
50
  f.router = this.router.clone();
@@ -496,11 +497,11 @@ var FederationBuilderImpl = class {
496
497
  };
497
498
  return setters;
498
499
  }
499
- setCollectionDispatcher(name, ...args) {
500
- return this.#setCustomCollectionDispatcher(name, "collection", ...args);
500
+ setCollectionDispatcher(name, itemType, path, dispatcher) {
501
+ return this.#setCustomCollectionDispatcher(name, "collection", itemType, path, dispatcher);
501
502
  }
502
- setOrderedCollectionDispatcher(name, ...args) {
503
- return this.#setCustomCollectionDispatcher(name, "orderedCollection", ...args);
503
+ setOrderedCollectionDispatcher(name, itemType, path, dispatcher) {
504
+ return this.#setCustomCollectionDispatcher(name, "orderedCollection", itemType, path, dispatcher);
504
505
  }
505
506
  #setCustomCollectionDispatcher(name, collectionType, itemType, path, dispatcher) {
506
507
  const strName = String(name);
@@ -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
  /**
@@ -16,29 +16,29 @@ interface NodeInfo {
16
16
  /**
17
17
  * Metadata about server software in use.
18
18
  */
19
- software: Software;
19
+ readonly software: Software;
20
20
  /**
21
21
  * The protocols supported on this server. At least one protocol must be
22
22
  * supported.
23
23
  */
24
- protocols: Protocol[];
24
+ readonly protocols: readonly Protocol[];
25
25
  /**
26
26
  * The third party sites this server can connect to via their application API.
27
27
  */
28
- services?: Services;
28
+ readonly services?: Services;
29
29
  /**
30
30
  * Whether this server allows open self-registration. Defaults to `false`.
31
31
  */
32
- openRegistrations?: boolean;
32
+ readonly openRegistrations?: boolean;
33
33
  /**
34
34
  * Usage statistics for this server.
35
35
  */
36
- usage: Usage;
36
+ readonly usage: Usage;
37
37
  /**
38
38
  * Free form key value pairs for software specific values.
39
39
  * Clients should not rely on any specific key present.
40
40
  */
41
- metadata?: Record<string, JsonValue>;
41
+ readonly metadata?: Readonly<Record<string, JsonValue>>;
42
42
  }
43
43
  /**
44
44
  * Metadata about server software in use.
@@ -48,19 +48,19 @@ interface Software {
48
48
  * The canonical name of this server software. This must comply with
49
49
  * pattern `/^[a-z0-9-]+$/`.
50
50
  */
51
- name: string;
51
+ readonly name: string;
52
52
  /**
53
53
  * The version of this server software.
54
54
  */
55
- version: string;
55
+ readonly version: string;
56
56
  /**
57
57
  * The URL of the source code repository of this server software.
58
58
  */
59
- repository?: URL;
59
+ readonly repository?: URL;
60
60
  /**
61
61
  * The URL of the homepage of this server software.
62
62
  */
63
- homepage?: URL;
63
+ readonly homepage?: URL;
64
64
  }
65
65
  /**
66
66
  * The protocols supported on this server.
@@ -74,12 +74,12 @@ interface Services {
74
74
  * The third party sites this server can retrieve messages from for combined
75
75
  * display with regular traffic.
76
76
  */
77
- inbound?: InboundService[];
77
+ readonly inbound?: readonly InboundService[];
78
78
  /**
79
79
  * The third party sites this server can publish messages to on the behalf
80
80
  * of a user.
81
81
  */
82
- outbound?: OutboundService[];
82
+ readonly outbound?: readonly OutboundService[];
83
83
  }
84
84
  /**
85
85
  * The third party sites this server can retrieve messages from for combined
@@ -98,33 +98,33 @@ interface Usage {
98
98
  /**
99
99
  * Statistics about the users of this server.
100
100
  */
101
- users: {
101
+ readonly users: {
102
102
  /**
103
103
  * The total amount of on this server registered users. This number
104
104
  * has to be an integer greater than or equal to zero.
105
105
  */
106
- total?: number;
106
+ readonly total?: number;
107
107
  /**
108
108
  * The amount of users that signed in at least once in the last 180 days.
109
109
  * This number has to be an integer greater than or equal to zero.
110
110
  */
111
- activeHalfyear?: number;
111
+ readonly activeHalfyear?: number;
112
112
  /**
113
113
  * The amount of users that signed in at least once in the last 30 days.
114
114
  * This number has to be an integer greater than or equal to zero.
115
115
  */
116
- activeMonth?: number;
116
+ readonly activeMonth?: number;
117
117
  };
118
118
  /**
119
119
  * The amount of posts that were made by users that are registered on this
120
120
  * server. This number has to be an integer greater than or equal to zero.
121
121
  */
122
- localPosts: number;
122
+ readonly localPosts: number;
123
123
  /**
124
124
  * The amount of comments that were made by users that are registered on this
125
125
  * server. This number has to be an integer greater than or equal to zero.
126
126
  */
127
- localComments: number;
127
+ readonly localComments: number;
128
128
  }
129
129
  /**
130
130
  * Converts a {@link NodeInfo} object to a JSON value.
@@ -3,8 +3,8 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { getUserAgent } from "./type-C69ZBu7f.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([
@@ -111,15 +111,14 @@ function parseNodeInfo(data, options = {}) {
111
111
  if (typeof data.metadata === "object" && data.metadata != null) metadata = Object.fromEntries(Object.entries(data.metadata));
112
112
  else if (!options.tryBestEffort) return null;
113
113
  }
114
- const result = {
114
+ return {
115
115
  software,
116
116
  protocols,
117
- usage
117
+ usage,
118
+ ...services != null && { services },
119
+ ...openRegistrations != null && { openRegistrations },
120
+ ...metadata != null && { metadata }
118
121
  };
119
- if (services != null) result.services = services;
120
- if (openRegistrations != null) result.openRegistrations = openRegistrations;
121
- if (metadata != null) result.metadata = metadata;
122
- return result;
123
122
  }
124
123
  function parseSoftware(data, options = {}) {
125
124
  if (typeof data !== "object" || data == null) {
@@ -155,13 +154,12 @@ function parseSoftware(data, options = {}) {
155
154
  }
156
155
  else if (!options.tryBestEffort) return null;
157
156
  }
158
- const result = {
157
+ return {
159
158
  name,
160
- version
159
+ version,
160
+ ...repository != null && { repository },
161
+ ...homepage != null && { homepage }
161
162
  };
162
- if (repository != null) result.repository = repository;
163
- if (homepage != null) result.homepage = homepage;
164
- return result;
165
163
  }
166
164
  function parseProtocol(data) {
167
165
  if (data === "activitypub" || data === "buddycloud" || data === "dfrn" || data === "diaspora" || data === "libertree" || data === "ostatus" || data === "pumpio" || data === "tent" || data === "xmpp" || data === "zot") return data;
@@ -184,10 +182,10 @@ function parseServices(data, options = {}) {
184
182
  outbound = os.filter((o) => o != null);
185
183
  if (os.length > outbound.length && !options.tryBestEffort) return null;
186
184
  }
187
- const result = {};
188
- if (inbound != null) result.inbound = inbound;
189
- if (outbound != null) result.outbound = outbound;
190
- return result;
185
+ return {
186
+ ...inbound != null && { inbound },
187
+ ...outbound != null && { outbound }
188
+ };
191
189
  }
192
190
  function parseInboundService(data) {
193
191
  if (data === "atom1.0" || data === "gnusocial" || data === "imap" || data === "pnut" || data === "pop3" || data === "pumpio" || data === "rss2.0" || data === "twitter") return data;
@@ -199,33 +197,40 @@ function parseOutboundService(data) {
199
197
  }
200
198
  function parseUsage(data, options = {}) {
201
199
  if (typeof data !== "object" || data == null) return null;
202
- const users = {};
200
+ let total;
201
+ let activeHalfyear;
202
+ let activeMonth;
203
203
  if ("users" in data && typeof data.users === "object" && data.users != null) {
204
- if ("total" in data.users) if (typeof data.users.total === "number") users.total = data.users.total;
204
+ if ("total" in data.users) if (typeof data.users.total === "number") total = data.users.total;
205
205
  else {
206
206
  if (!options.tryBestEffort) return null;
207
207
  if (typeof data.users.total === "string") {
208
208
  const n = parseInt(data.users.total);
209
- if (!isNaN(n)) users.total = n;
209
+ if (!isNaN(n)) total = n;
210
210
  }
211
211
  }
212
- if ("activeHalfyear" in data.users) if (typeof data.users.activeHalfyear === "number") users.activeHalfyear = data.users.activeHalfyear;
212
+ if ("activeHalfyear" in data.users) if (typeof data.users.activeHalfyear === "number") activeHalfyear = data.users.activeHalfyear;
213
213
  else {
214
214
  if (!options.tryBestEffort) return null;
215
215
  if (typeof data.users.activeHalfyear === "string") {
216
216
  const n = parseInt(data.users.activeHalfyear);
217
- if (!isNaN(n)) users.activeHalfyear = n;
217
+ if (!isNaN(n)) activeHalfyear = n;
218
218
  }
219
219
  }
220
- if ("activeMonth" in data.users) if (typeof data.users.activeMonth === "number") users.activeMonth = data.users.activeMonth;
220
+ if ("activeMonth" in data.users) if (typeof data.users.activeMonth === "number") activeMonth = data.users.activeMonth;
221
221
  else {
222
222
  if (!options.tryBestEffort) return null;
223
223
  if (typeof data.users.activeMonth === "string") {
224
224
  const n = parseInt(data.users.activeMonth);
225
- if (!isNaN(n)) users.activeMonth = n;
225
+ if (!isNaN(n)) activeMonth = n;
226
226
  }
227
227
  }
228
228
  } else if (!options.tryBestEffort) return null;
229
+ const users = {
230
+ ...total != null && { total },
231
+ ...activeHalfyear != null && { activeHalfyear },
232
+ ...activeMonth != null && { activeMonth }
233
+ };
229
234
  let localPosts = 0;
230
235
  if ("localPosts" in data) if (typeof data.localPosts === "number") localPosts = data.localPosts;
231
236
  else {
@@ -1,4 +1,4 @@
1
- import { GetUserAgentOptions } from "./docloader-D-MrRyHl.cjs";
1
+ import { GetUserAgentOptions } from "@fedify/vocab-runtime";
2
2
 
3
3
  //#region src/nodeinfo/types.d.ts
4
4
  /**
@@ -14,29 +14,29 @@ interface NodeInfo {
14
14
  /**
15
15
  * Metadata about server software in use.
16
16
  */
17
- software: Software;
17
+ readonly software: Software;
18
18
  /**
19
19
  * The protocols supported on this server. At least one protocol must be
20
20
  * supported.
21
21
  */
22
- protocols: Protocol[];
22
+ readonly protocols: readonly Protocol[];
23
23
  /**
24
24
  * The third party sites this server can connect to via their application API.
25
25
  */
26
- services?: Services;
26
+ readonly services?: Services;
27
27
  /**
28
28
  * Whether this server allows open self-registration. Defaults to `false`.
29
29
  */
30
- openRegistrations?: boolean;
30
+ readonly openRegistrations?: boolean;
31
31
  /**
32
32
  * Usage statistics for this server.
33
33
  */
34
- usage: Usage;
34
+ readonly usage: Usage;
35
35
  /**
36
36
  * Free form key value pairs for software specific values.
37
37
  * Clients should not rely on any specific key present.
38
38
  */
39
- metadata?: Record<string, JsonValue>;
39
+ readonly metadata?: Readonly<Record<string, JsonValue>>;
40
40
  }
41
41
  /**
42
42
  * Metadata about server software in use.
@@ -46,19 +46,19 @@ interface Software {
46
46
  * The canonical name of this server software. This must comply with
47
47
  * pattern `/^[a-z0-9-]+$/`.
48
48
  */
49
- name: string;
49
+ readonly name: string;
50
50
  /**
51
51
  * The version of this server software.
52
52
  */
53
- version: string;
53
+ readonly version: string;
54
54
  /**
55
55
  * The URL of the source code repository of this server software.
56
56
  */
57
- repository?: URL;
57
+ readonly repository?: URL;
58
58
  /**
59
59
  * The URL of the homepage of this server software.
60
60
  */
61
- homepage?: URL;
61
+ readonly homepage?: URL;
62
62
  }
63
63
  /**
64
64
  * The protocols supported on this server.
@@ -72,12 +72,12 @@ interface Services {
72
72
  * The third party sites this server can retrieve messages from for combined
73
73
  * display with regular traffic.
74
74
  */
75
- inbound?: InboundService[];
75
+ readonly inbound?: readonly InboundService[];
76
76
  /**
77
77
  * The third party sites this server can publish messages to on the behalf
78
78
  * of a user.
79
79
  */
80
- outbound?: OutboundService[];
80
+ readonly outbound?: readonly OutboundService[];
81
81
  }
82
82
  /**
83
83
  * The third party sites this server can retrieve messages from for combined
@@ -96,33 +96,33 @@ interface Usage {
96
96
  /**
97
97
  * Statistics about the users of this server.
98
98
  */
99
- users: {
99
+ readonly users: {
100
100
  /**
101
101
  * The total amount of on this server registered users. This number
102
102
  * has to be an integer greater than or equal to zero.
103
103
  */
104
- total?: number;
104
+ readonly total?: number;
105
105
  /**
106
106
  * The amount of users that signed in at least once in the last 180 days.
107
107
  * This number has to be an integer greater than or equal to zero.
108
108
  */
109
- activeHalfyear?: number;
109
+ readonly activeHalfyear?: number;
110
110
  /**
111
111
  * The amount of users that signed in at least once in the last 30 days.
112
112
  * This number has to be an integer greater than or equal to zero.
113
113
  */
114
- activeMonth?: number;
114
+ readonly activeMonth?: number;
115
115
  };
116
116
  /**
117
117
  * The amount of posts that were made by users that are registered on this
118
118
  * server. This number has to be an integer greater than or equal to zero.
119
119
  */
120
- localPosts: number;
120
+ readonly localPosts: number;
121
121
  /**
122
122
  * The amount of comments that were made by users that are registered on this
123
123
  * server. This number has to be an integer greater than or equal to zero.
124
124
  */
125
- localComments: number;
125
+ readonly localComments: number;
126
126
  }
127
127
  /**
128
128
  * Converts a {@link NodeInfo} object to a JSON value.