@fedify/fedify 2.0.0-pr.490.2 → 2.0.0-pr.559.5

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 (277) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +64 -37
  3. package/dist/{builder-4syLV1-z.js → builder-BJ8JxPW5.js} +10 -3
  4. package/dist/{chunk-DqRYRqnO.cjs → chunk-CGaQZ11T.cjs} +19 -0
  5. package/dist/chunk-DJNbSFdH.js +29 -0
  6. package/dist/{client-94iWEfQa.d.cts → client-CwkOPN13.d.cts} +18 -18
  7. package/dist/{client-pY7-3icS.js → client-Dg7OfUDA.js} +28 -23
  8. package/dist/{client-BsGzbnV-.d.ts → client-a7NwzhA2.d.ts} +18 -18
  9. package/dist/compat/mod.cjs +1 -1
  10. package/dist/compat/mod.d.cts +6 -10
  11. package/dist/compat/mod.d.ts +6 -10
  12. package/dist/compat/mod.js +2 -2
  13. package/dist/compat/transformers.test.js +22 -21
  14. package/dist/context-CZ5llAss.js +109 -0
  15. package/dist/{context-PxGADCsD.d.cts → context-Cf0-LmZC.d.cts} +206 -74
  16. package/dist/{context-V-XS2_6O.d.ts → context-liIe6DFH.d.ts} +206 -74
  17. package/dist/deno-CQvbJJs6.js +125 -0
  18. package/dist/{testing-BslrM_9E.js → dist-B5f6a8Tt.js} +90 -110
  19. package/dist/{docloader-DndkGj0O.js → docloader-C7haPFrm.js} +3 -3
  20. package/dist/{esm-VlKMJQqV.js → esm-DGl7uK1r.js} +1 -1
  21. package/dist/federation/builder.test.js +7 -5
  22. package/dist/federation/collection.test.js +2 -3
  23. package/dist/federation/handler.test.js +24 -23
  24. package/dist/federation/idempotency.test.js +59 -22
  25. package/dist/federation/inbox.test.js +4 -3
  26. package/dist/federation/keycache.test.js +4 -4
  27. package/dist/federation/kv.test.js +56 -3
  28. package/dist/federation/middleware.test.js +307 -93
  29. package/dist/federation/mod.cjs +9 -10
  30. package/dist/federation/mod.d.cts +7 -11
  31. package/dist/federation/mod.d.ts +7 -11
  32. package/dist/federation/mod.js +8 -11
  33. package/dist/federation/mq.test.js +167 -16
  34. package/dist/federation/negotiation.test.js +2 -3
  35. package/dist/federation/retry.test.js +2 -3
  36. package/dist/federation/router.test.js +2 -2
  37. package/dist/federation/send.test.js +93 -11
  38. package/dist/{webfinger/handler.test.js → federation/webfinger.test.js} +24 -22
  39. package/dist/{federation-CRpdnOMS.cjs → federation-Bp3HI26G.cjs} +117 -11
  40. package/dist/{federation-jcR8-ZxP.js → federation-DaMfqRm4.js} +122 -16
  41. package/dist/{http-YhR_TMMQ.js → http-BO0w34cM.js} +127 -9
  42. package/dist/{http-M8k5mKc0.d.cts → http-CCEu-x1_.d.cts} +1 -1
  43. package/dist/{http-BbO0ejuk.d.ts → http-CODSJcKx.d.ts} +1 -1
  44. package/dist/{http-Dxpqz4hE.cjs → http-D3jnynqJ.cjs} +141 -17
  45. package/dist/{http-DH47B-h3.js → http-D75q_hW-.js} +3 -2
  46. package/dist/{inbox-CEyHvxOo.js → inbox-DHboTK3x.js} +2 -1
  47. package/dist/{key-x7E5PYI0.js → key-DzOIwgIi.js} +3 -3
  48. package/dist/{keycache-BRXuBDuy.js → keycache-DRxpZ5r9.js} +1 -1
  49. package/dist/{keys-DLk_8H-l.js → keys-ZbcByPg9.js} +1 -1
  50. package/dist/{kv-CRZrzyXm.js → kv-QzKcOQgP.js} +22 -0
  51. package/dist/{kv-cache-DN9pfMBe.js → kv-cache-B__dHl7g.js} +15 -2
  52. package/dist/{kv-cache-BMpfJFTx.cjs → kv-cache-Chn8IE8p.cjs} +4 -4
  53. package/dist/{kv-cache-HFnFIjSD.js → kv-cache-JQOZpm43.js} +3 -3
  54. package/dist/{kv-Bxr0Q87_.d.cts → kv-g9jFc34-.d.cts} +30 -1
  55. package/dist/{kv-BKNZ-Tb-.d.ts → kv-jg_8SMc1.d.ts} +30 -1
  56. package/dist/{ld-CRPaU6c8.js → ld-BDvJI1Ch.js} +4 -3
  57. package/dist/middleware-BDPlUI8Z.js +12 -0
  58. package/dist/{middleware-DfLpMu7C.js → middleware-C1SMUD_l.js} +280 -166
  59. package/dist/middleware-C3SOA_O_.cjs +12 -0
  60. package/dist/{middleware-BIqFwRwI.js → middleware-CqxuI8xD.js} +245 -178
  61. package/dist/{middleware-Ck7O6mb0.cjs → middleware-DATx715C.cjs} +333 -207
  62. package/dist/middleware-HBYhBAM1.js +26 -0
  63. package/dist/{mod-Cdo6SYlJ.d.ts → mod-B9_l3te3.d.ts} +4 -4
  64. package/dist/mod-Bh8mqlYw.d.cts +9 -0
  65. package/dist/{mod-DgxG-byT.d.cts → mod-COO7VMcm.d.cts} +2 -2
  66. package/dist/{mod-aAE2wOWV.d.ts → mod-CvhyLrjX.d.ts} +7 -7
  67. package/dist/mod-D6HodEq7.d.ts +7 -0
  68. package/dist/{mod-DMpuiKXi.d.cts → mod-DWaA45ef.d.cts} +7 -7
  69. package/dist/mod-Do_sZWAA.d.cts +62 -0
  70. package/dist/mod-Dquroqiv.d.ts +64 -0
  71. package/dist/{mod-BoRKfJPE.d.cts → mod-H3ScYaOb.d.cts} +4 -4
  72. package/dist/{mod-D5Z2tISD.d.ts → mod-q2IR8UiH.d.ts} +2 -2
  73. package/dist/mod.cjs +61 -93
  74. package/dist/mod.d.cts +20 -15
  75. package/dist/mod.d.ts +21 -15
  76. package/dist/mod.js +61 -16
  77. package/dist/nodeinfo/client.test.js +3 -4
  78. package/dist/nodeinfo/handler.test.js +22 -21
  79. package/dist/nodeinfo/mod.cjs +2 -2
  80. package/dist/nodeinfo/mod.d.cts +2 -2
  81. package/dist/nodeinfo/mod.d.ts +2 -2
  82. package/dist/nodeinfo/mod.js +2 -2
  83. package/dist/nodeinfo/types.test.js +2 -3
  84. package/dist/otel/exporter.test.js +893 -0
  85. package/dist/otel/mod.cjs +256 -0
  86. package/dist/otel/mod.d.cts +230 -0
  87. package/dist/otel/mod.d.ts +232 -0
  88. package/dist/otel/mod.js +255 -0
  89. package/dist/{owner-B4HbyP8s.d.cts → owner-9yZ5Ibsb.d.cts} +1 -2
  90. package/dist/{owner-kQRGVXG1.d.ts → owner-DQYAbVmX.d.ts} +1 -2
  91. package/dist/{owner-CIWnopkT.js → owner-DSRxYIP4.js} +2 -2
  92. package/dist/{proof-D-5ri6rf.js → proof-9WkFZv2S.js} +3 -2
  93. package/dist/{proof-fEwcA7LA.cjs → proof-CWEkXV08.cjs} +25 -26
  94. package/dist/{proof-C8-2l0zH.js → proof-C_XZU5IE.js} +4 -5
  95. package/dist/router-D9eI0s4b.js +118 -0
  96. package/dist/runtime/mod.cjs +14 -0
  97. package/dist/runtime/mod.d.cts +2 -0
  98. package/dist/{vocab/lookup.test.d.ts → runtime/mod.d.ts} +2 -1
  99. package/dist/runtime/mod.js +7 -0
  100. package/dist/runtime-c2Njxsry.cjs +17 -0
  101. package/dist/runtime-poamPCMb.js +13 -0
  102. package/dist/{send-CPGk9QKZ.js → send-qOq9Dgkb.js} +38 -4
  103. package/dist/sig/http.test.js +6 -7
  104. package/dist/sig/key.test.js +5 -5
  105. package/dist/sig/ld.test.js +6 -6
  106. package/dist/sig/mod.cjs +3 -5
  107. package/dist/sig/mod.d.cts +3 -5
  108. package/dist/sig/mod.d.ts +3 -5
  109. package/dist/sig/mod.js +3 -5
  110. package/dist/sig/owner.test.js +6 -7
  111. package/dist/sig/proof.test.js +6 -6
  112. package/dist/testing/mod.d.ts +173 -7006
  113. package/dist/testing/mod.js +4 -3
  114. package/dist/{transformers-CoBS-oFG.cjs → transformers-3g8GZwkZ.cjs} +3 -3
  115. package/dist/{transformers-BFT6d7J5.js → transformers-C3FLHUd6.js} +2 -2
  116. package/dist/{types-BtUjyi5y.js → types-C93Ob9cU.js} +30 -25
  117. package/dist/{types-C2XVl6gj.js → types-CPz01LGH.js} +3 -3
  118. package/dist/{types-CWgzGaqk.cjs → types-Cd_hszr_.cjs} +31 -26
  119. package/dist/utils/docloader.test.js +7 -8
  120. package/dist/utils/kv-cache.test.js +5 -3
  121. package/dist/utils/mod.cjs +3 -5
  122. package/dist/utils/mod.d.cts +3 -4
  123. package/dist/utils/mod.d.ts +3 -4
  124. package/dist/utils/mod.js +3 -5
  125. package/dist/vocab/mod.cjs +8 -81
  126. package/dist/vocab/mod.d.cts +1 -4
  127. package/dist/vocab/mod.d.ts +1 -4
  128. package/dist/vocab/mod.js +1 -5
  129. package/package.json +37 -27
  130. package/dist/actor-BT-e5fn9.js +0 -146
  131. package/dist/actor-B_gRMloq.js +0 -41647
  132. package/dist/actor-CBfPjuWj.cjs +0 -42079
  133. package/dist/actor-DqFajh9s.d.ts +0 -130
  134. package/dist/actor-f2NtjyCg.d.cts +0 -128
  135. package/dist/fixtures/activitypub.academy/users/brauca_darradiul.json +0 -83
  136. package/dist/fixtures/example.com/announce.json +0 -6
  137. package/dist/fixtures/example.com/collection.json +0 -19
  138. package/dist/fixtures/example.com/create.json +0 -6
  139. package/dist/fixtures/example.com/cross-origin-actor.json +0 -6
  140. package/dist/fixtures/example.com/hong-gildong.json +0 -11
  141. package/dist/fixtures/example.com/invite.json +0 -7
  142. package/dist/fixtures/example.com/key.json +0 -7
  143. package/dist/fixtures/example.com/key2.json +0 -6
  144. package/dist/fixtures/example.com/object.json +0 -6
  145. package/dist/fixtures/example.com/orderedcollectionpage.json +0 -24
  146. package/dist/fixtures/example.com/paged/a.json +0 -13
  147. package/dist/fixtures/example.com/paged/b.json +0 -16
  148. package/dist/fixtures/example.com/paged-collection.json +0 -6
  149. package/dist/fixtures/example.com/person.json +0 -22
  150. package/dist/fixtures/example.com/person2.json +0 -40
  151. package/dist/fixtures/example.com/test.json +0 -5
  152. package/dist/fixtures/example.com/users/handle.json +0 -16
  153. package/dist/fixtures/example.com/wrong-type.json +0 -3
  154. package/dist/fixtures/media.example.com/avatars/test-avatar.jpg.json +0 -6
  155. package/dist/fixtures/oeee.cafe/ap/users/3609fd4e-d51d-4db8-9f04-4189815864dd.json +0 -24
  156. package/dist/fixtures/remote.domain/users/bob.json +0 -20
  157. package/dist/fixtures/server.example/users/alice.json +0 -20
  158. package/dist/fixtures/w3id.org/identity/v1.json +0 -152
  159. package/dist/fixtures/w3id.org/security/data-integrity/v1.json +0 -74
  160. package/dist/fixtures/w3id.org/security/multikey/v1.json +0 -35
  161. package/dist/fixtures/w3id.org/security/v1.json +0 -50
  162. package/dist/fixtures/wizard.casa/users/hongminhee.json +0 -69
  163. package/dist/fixtures/www.w3.org/ns/activitystreams.json +0 -379
  164. package/dist/fixtures/www.w3.org/ns/did/v1.json +0 -58
  165. package/dist/lookup-BTqtVATt.cjs +0 -266
  166. package/dist/lookup-DOSnR912.js +0 -254
  167. package/dist/lookup-Dj9-mgOn.js +0 -42184
  168. package/dist/middleware-CxswDtQn.js +0 -15
  169. package/dist/middleware-CyITsnX0.js +0 -26
  170. package/dist/middleware-Z8lc_drL.cjs +0 -15
  171. package/dist/mod-BlVovdcy.d.ts +0 -309
  172. package/dist/mod-BxRCHTz-.d.cts +0 -307
  173. package/dist/mod-C58MZ7Wx.d.cts +0 -113
  174. package/dist/mod-CcDPcLJW.d.cts +0 -1
  175. package/dist/mod-Ds0mpFZU.d.ts +0 -115
  176. package/dist/mod-bjzj5QIb.d.ts +0 -2
  177. package/dist/otel-1BmGPuZc.js +0 -64
  178. package/dist/src/vocab/accept.yaml +0 -15
  179. package/dist/src/vocab/activity.yaml +0 -98
  180. package/dist/src/vocab/add.yaml +0 -16
  181. package/dist/src/vocab/announce.yaml +0 -30
  182. package/dist/src/vocab/application.yaml +0 -324
  183. package/dist/src/vocab/arrive.yaml +0 -15
  184. package/dist/src/vocab/article.yaml +0 -46
  185. package/dist/src/vocab/audio.yaml +0 -11
  186. package/dist/src/vocab/block.yaml +0 -16
  187. package/dist/src/vocab/chatmessage.yaml +0 -50
  188. package/dist/src/vocab/collection.yaml +0 -154
  189. package/dist/src/vocab/collectionpage.yaml +0 -55
  190. package/dist/src/vocab/create.yaml +0 -28
  191. package/dist/src/vocab/dataintegrityproof.yaml +0 -56
  192. package/dist/src/vocab/delete.yaml +0 -27
  193. package/dist/src/vocab/didservice.yaml +0 -22
  194. package/dist/src/vocab/dislike.yaml +0 -14
  195. package/dist/src/vocab/document.yaml +0 -31
  196. package/dist/src/vocab/emoji.yaml +0 -12
  197. package/dist/src/vocab/emojireact.yaml +0 -17
  198. package/dist/src/vocab/endpoints.yaml +0 -85
  199. package/dist/src/vocab/event.yaml +0 -11
  200. package/dist/src/vocab/export.yaml +0 -9
  201. package/dist/src/vocab/flag.yaml +0 -15
  202. package/dist/src/vocab/follow.yaml +0 -19
  203. package/dist/src/vocab/group.yaml +0 -324
  204. package/dist/src/vocab/hashtag.yaml +0 -14
  205. package/dist/src/vocab/ignore.yaml +0 -14
  206. package/dist/src/vocab/image.yaml +0 -9
  207. package/dist/src/vocab/intransitiveactivity.yaml +0 -15
  208. package/dist/src/vocab/invite.yaml +0 -14
  209. package/dist/src/vocab/join.yaml +0 -14
  210. package/dist/src/vocab/key.yaml +0 -28
  211. package/dist/src/vocab/leave.yaml +0 -14
  212. package/dist/src/vocab/like.yaml +0 -16
  213. package/dist/src/vocab/link.yaml +0 -101
  214. package/dist/src/vocab/listen.yaml +0 -12
  215. package/dist/src/vocab/mention.yaml +0 -9
  216. package/dist/src/vocab/move.yaml +0 -15
  217. package/dist/src/vocab/multikey.yaml +0 -36
  218. package/dist/src/vocab/note.yaml +0 -48
  219. package/dist/src/vocab/object.yaml +0 -404
  220. package/dist/src/vocab/offer.yaml +0 -15
  221. package/dist/src/vocab/orderedcollection.yaml +0 -39
  222. package/dist/src/vocab/orderedcollectionpage.yaml +0 -50
  223. package/dist/src/vocab/organization.yaml +0 -324
  224. package/dist/src/vocab/page.yaml +0 -11
  225. package/dist/src/vocab/person.yaml +0 -324
  226. package/dist/src/vocab/place.yaml +0 -75
  227. package/dist/src/vocab/profile.yaml +0 -26
  228. package/dist/src/vocab/propertyvalue.yaml +0 -32
  229. package/dist/src/vocab/question.yaml +0 -103
  230. package/dist/src/vocab/read.yaml +0 -13
  231. package/dist/src/vocab/reject.yaml +0 -14
  232. package/dist/src/vocab/relationship.yaml +0 -52
  233. package/dist/src/vocab/remove.yaml +0 -14
  234. package/dist/src/vocab/service.yaml +0 -324
  235. package/dist/src/vocab/source.yaml +0 -26
  236. package/dist/src/vocab/tentativeaccept.yaml +0 -14
  237. package/dist/src/vocab/tentativereject.yaml +0 -14
  238. package/dist/src/vocab/tombstone.yaml +0 -24
  239. package/dist/src/vocab/travel.yaml +0 -16
  240. package/dist/src/vocab/undo.yaml +0 -26
  241. package/dist/src/vocab/update.yaml +0 -58
  242. package/dist/src/vocab/video.yaml +0 -11
  243. package/dist/src/vocab/view.yaml +0 -13
  244. package/dist/testing/docloader.test.js +0 -22
  245. package/dist/vocab/actor.test.js +0 -5963
  246. package/dist/vocab/lookup.test.js +0 -476
  247. package/dist/vocab/type.test.d.ts +0 -3
  248. package/dist/vocab/type.test.js +0 -24
  249. package/dist/vocab/vocab.test.d.ts +0 -3
  250. package/dist/vocab/vocab.test.js +0 -9397
  251. package/dist/vocab-BCWe1Ih5.d.ts +0 -14905
  252. package/dist/vocab-ByUp-A2_.js +0 -260
  253. package/dist/vocab-CeDBzu-f.d.cts +0 -14903
  254. package/dist/vocab-X_X5T8D3.cjs +0 -296
  255. package/dist/webfinger/handler.test.d.ts +0 -3
  256. package/dist/webfinger/lookup.test.d.ts +0 -3
  257. package/dist/webfinger/lookup.test.js +0 -193
  258. package/dist/webfinger/mod.cjs +0 -8
  259. package/dist/webfinger/mod.d.cts +0 -2
  260. package/dist/webfinger/mod.d.ts +0 -4
  261. package/dist/webfinger/mod.js +0 -8
  262. package/dist/webfinger-C72Y8lrh.js +0 -4
  263. package/dist/webfinger-vAtLmxOF.cjs +0 -4
  264. /package/dist/{collection-BzWsN9pB.js → collection-CcnIw1qY.js} +0 -0
  265. /package/dist/{compat-nxUqe4Z-.js → compat-Bb4NuTUO.js} +0 -0
  266. /package/dist/{testing/docloader.test.d.ts → federation/webfinger.test.d.ts} +0 -0
  267. /package/dist/{mod-CVgZgliM.d.ts → mod-AGjRfPjT.d.ts} +0 -0
  268. /package/dist/{mod-B-hUPT2N.d.cts → mod-gq_Xfdz8.d.cts} +0 -0
  269. /package/dist/{negotiation-C4nFufNk.js → negotiation-5NPJL6zp.js} +0 -0
  270. /package/dist/{nodeinfo-BnthBobC.js → nodeinfo-DoESQxq5.js} +0 -0
  271. /package/dist/{nodeinfo-CdN0rEnZ.cjs → nodeinfo-DuMYTpbZ.cjs} +0 -0
  272. /package/dist/{vocab/actor.test.d.ts → otel/exporter.test.d.ts} +0 -0
  273. /package/dist/{retry-CfF8Gn4d.js → retry-D4GJ670a.js} +0 -0
  274. /package/dist/{sig-C34-oHBl.js → sig-BNhspNOf.js} +0 -0
  275. /package/dist/{sig-YYj5tCnr.cjs → sig-vX39WyWI.cjs} +0 -0
  276. /package/dist/{utils-DyRU1gdZ.cjs → utils-BQ9KqEK9.cjs} +0 -0
  277. /package/dist/{utils-D-Va7aXC.js → utils-Dn5OPdSW.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,32 +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/fastify](/packages/fastify/) | [JSR][jsr:@fedify/fastify] | [npm][npm:@fedify/fastify] | Fastify integration |
103
- | [@fedify/h3](/packages/h3/) | [JSR][jsr:@fedify/h3] | [npm][npm:@fedify/h3] | H3 integration |
104
- | [@fedify/hono](/packages/hono/) | [JSR][jsr:@fedify/hono] | [npm][npm:@fedify/hono] | Hono integration |
105
- | [@fedify/koa](/packages/koa/) | [JSR][jsr:@fedify/koa] | [npm][npm:@fedify/koa] | Koa integration |
106
- | [@fedify/nestjs](/packages/nestjs/) | | [npm][npm:@fedify/nestjs] | NestJS integration |
107
- | [@fedify/next](/packages/next/) | | [npm][npm:@fedify/next] | Next.js integration |
108
- | [@fedify/postgres](/packages/postgres/) | [JSR][jsr:@fedify/postgres] | [npm][npm:@fedify/postgres] | PostgreSQL driver |
109
- | [@fedify/redis](/packages/redis/) | [JSR][jsr:@fedify/redis] | [npm][npm:@fedify/redis] | Redis driver |
110
- | [@fedify/relay](/packages/relay/) | [JSR][jsr:@fedify/relay] | [npm][npm:@fedify/relay] | ActivityPub relay support |
111
- | [@fedify/sqlite](/packages/sqlite/) | [JSR][jsr:@fedify/sqlite] | [npm][npm:@fedify/sqlite] | SQLite driver |
112
- | [@fedify/sveltekit](/packages/sveltekit/) | [JSR][jsr:@fedify/sveltekit] | [npm][npm:@fedify/sveltekit] | SvelteKit integration |
113
- | [@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 |
114
124
 
115
125
  [jsr:@fedify/cli]: https://jsr.io/@fedify/cli
116
126
  [npm:@fedify/cli]: https://www.npmjs.com/package/@fedify/cli
@@ -124,12 +134,15 @@ Here is the list of packages:
124
134
  [npm:@fedify/express]: https://www.npmjs.com/package/@fedify/express
125
135
  [jsr:@fedify/fastify]: https://jsr.io/@fedify/fastify
126
136
  [npm:@fedify/fastify]: https://www.npmjs.com/package/@fedify/fastify
137
+ [jsr:@fedify/fresh]: https://jsr.io/@fedify/fresh
127
138
  [jsr:@fedify/h3]: https://jsr.io/@fedify/h3
128
139
  [npm:@fedify/h3]: https://www.npmjs.com/package/@fedify/h3
129
140
  [jsr:@fedify/hono]: https://jsr.io/@fedify/hono
130
141
  [npm:@fedify/hono]: https://www.npmjs.com/package/@fedify/hono
131
142
  [jsr:@fedify/koa]: https://jsr.io/@fedify/koa
132
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
133
146
  [npm:@fedify/nestjs]: https://www.npmjs.com/package/@fedify/nestjs
134
147
  [npm:@fedify/next]: https://www.npmjs.com/package/@fedify/next
135
148
  [jsr:@fedify/postgres]: https://jsr.io/@fedify/postgres
@@ -144,6 +157,14 @@ Here is the list of packages:
144
157
  [npm:@fedify/sveltekit]: https://www.npmjs.com/package/@fedify/sveltekit
145
158
  [jsr:@fedify/testing]: https://jsr.io/@fedify/testing
146
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
147
168
 
148
169
 
149
170
  Sponsors
@@ -155,7 +176,10 @@ financial contributors:[^2]
155
176
 
156
177
  [^2]: Those lists are automatically updated every hour.
157
178
 
179
+ <!-- hongdown-disable -->
180
+
158
181
  <!-- cSpell: disable -->
182
+
159
183
  <!-- DO NOT EDIT(h3): this section is automatically generated by the script -->
160
184
 
161
185
  ### Corporate sponsors
@@ -178,8 +202,11 @@ Robin Riley, yamanoku, Encyclia, taye, okin, Andy Piper, box464, Evan Prodromou,
178
202
  Robin Riley, Markus P, Nils Bergmann, Rameez
179
203
 
180
204
  <!-- /DO NOT EDIT -->
205
+
181
206
  <!-- cSpell: enable -->
182
207
 
208
+ <!-- hongdown-enable -->
209
+
183
210
  ### Become a sponsor
184
211
 
185
212
  We welcome financial contributions to help us maintain and improve this project.
@@ -3,9 +3,11 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { Router, RouterError, deno_default, getTypeId } from "./lookup-Dj9-mgOn.js";
7
- import { InboxListenerSet } from "./inbox-CEyHvxOo.js";
6
+ import { deno_default } from "./deno-CQvbJJs6.js";
7
+ import { Router, RouterError } from "./router-D9eI0s4b.js";
8
+ import { InboxListenerSet } from "./inbox-DHboTK3x.js";
8
9
  import { getLogger } from "@logtape/logtape";
10
+ import { getTypeId } from "@fedify/vocab";
9
11
  import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
10
12
 
11
13
  //#region src/federation/builder.ts
@@ -27,6 +29,7 @@ var FederationBuilderImpl = class {
27
29
  inboxListeners;
28
30
  inboxErrorHandler;
29
31
  sharedInboxKeyDispatcher;
32
+ outboxPermanentFailureHandler;
30
33
  idempotencyStrategy;
31
34
  collectionTypeIds;
32
35
  collectionCallbacks;
@@ -42,7 +45,7 @@ var FederationBuilderImpl = class {
42
45
  this.collectionTypeIds = {};
43
46
  }
44
47
  async build(options) {
45
- const { FederationImpl } = await import("./middleware-CyITsnX0.js");
48
+ const { FederationImpl } = await import("./middleware-HBYhBAM1.js");
46
49
  const f = new FederationImpl(options);
47
50
  const trailingSlashInsensitiveValue = f.router.trailingSlashInsensitive;
48
51
  f.router = this.router.clone();
@@ -64,6 +67,7 @@ var FederationBuilderImpl = class {
64
67
  f.inboxListeners = this.inboxListeners?.clone();
65
68
  f.inboxErrorHandler = this.inboxErrorHandler;
66
69
  f.sharedInboxKeyDispatcher = this.sharedInboxKeyDispatcher;
70
+ f.outboxPermanentFailureHandler = this.outboxPermanentFailureHandler;
67
71
  f.idempotencyStrategy = this.idempotencyStrategy;
68
72
  return f;
69
73
  }
@@ -545,6 +549,9 @@ var FederationBuilderImpl = class {
545
549
  const path = this.router.build(`collection:${routeName}`, values) ?? this.router.build(`orderedCollection:${routeName}`, values);
546
550
  return path;
547
551
  }
552
+ setOutboxPermanentFailureHandler(handler) {
553
+ this.outboxPermanentFailureHandler = handler;
554
+ }
548
555
  /**
549
556
  * Converts a name (string or symbol) to a unique string identifier.
550
557
  * For symbols, generates and caches a UUID if not already present.
@@ -9,6 +9,12 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
9
9
  var __getOwnPropNames = Object.getOwnPropertyNames;
10
10
  var __getProtoOf = Object.getPrototypeOf;
11
11
  var __hasOwnProp = Object.prototype.hasOwnProperty;
12
+ var __export = (target, all) => {
13
+ for (var name in all) __defProp(target, name, {
14
+ get: all[name],
15
+ enumerable: true
16
+ });
17
+ };
12
18
  var __copyProps = (to, from, except, desc) => {
13
19
  if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
14
20
  key = keys[i];
@@ -19,6 +25,7 @@ var __copyProps = (to, from, except, desc) => {
19
25
  }
20
26
  return to;
21
27
  };
28
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
22
29
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
23
30
  value: mod,
24
31
  enumerable: true
@@ -26,6 +33,18 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
33
 
27
34
  //#endregion
28
35
 
36
+ Object.defineProperty(exports, '__export', {
37
+ enumerable: true,
38
+ get: function () {
39
+ return __export;
40
+ }
41
+ });
42
+ Object.defineProperty(exports, '__reExport', {
43
+ enumerable: true,
44
+ get: function () {
45
+ return __reExport;
46
+ }
47
+ });
29
48
  Object.defineProperty(exports, '__toESM', {
30
49
  enumerable: true,
31
50
  get: function () {
@@ -0,0 +1,29 @@
1
+
2
+ import { Temporal } from "@js-temporal/polyfill";
3
+ import { URLPattern } from "urlpattern-polyfill";
4
+
5
+ //#region rolldown:runtime
6
+ var __defProp = Object.defineProperty;
7
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
8
+ var __getOwnPropNames = Object.getOwnPropertyNames;
9
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
10
+ var __export = (target, all) => {
11
+ for (var name in all) __defProp(target, name, {
12
+ get: all[name],
13
+ enumerable: true
14
+ });
15
+ };
16
+ var __copyProps = (to, from, except, desc) => {
17
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
18
+ key = keys[i];
19
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
20
+ get: ((k) => from[k]).bind(null, key),
21
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
22
+ });
23
+ }
24
+ return to;
25
+ };
26
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
27
+
28
+ //#endregion
29
+ export { __export, __reExport };
@@ -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.
@@ -3,8 +3,8 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { getUserAgent } from "@fedify/vocab-runtime";
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 {