@fedify/fedify 2.0.0-dev.1875 → 2.0.0-dev.196

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 (283) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +68 -35
  3. package/dist/{builder-CLT_zIyw.js → builder-R1Sfe-tb.js} +5 -3
  4. package/dist/{client-BsGzbnV-.d.ts → client-CUTUGgvJ.d.ts} +18 -18
  5. package/dist/{client-pY7-3icS.js → client-Dg7OfUDA.js} +28 -23
  6. package/dist/{client-94iWEfQa.d.cts → client-by-PEGAJ.d.cts} +18 -18
  7. package/dist/compat/mod.cjs +1 -1
  8. package/dist/compat/mod.d.cts +6 -11
  9. package/dist/compat/mod.d.ts +6 -11
  10. package/dist/compat/mod.js +1 -1
  11. package/dist/compat/transformers.test.js +22 -21
  12. package/dist/context-Bns6uTJq.js +109 -0
  13. package/dist/{context-DG0huGW-.d.ts → context-C7vzWilY.d.ts} +200 -65
  14. package/dist/{context-DJ8aSy2Q.d.cts → context-CrB9RFy5.d.cts} +200 -65
  15. package/dist/deno-i60L3ZJW.js +117 -0
  16. package/dist/{testing-CW4N8vgf.js → dist-B5f6a8Tt.js} +90 -110
  17. package/dist/{docloader-BkhI_RcC.js → docloader-BuOglEYx.js} +3 -3
  18. package/dist/{esm-DOqAYjlY.js → esm-DGl7uK1r.js} +32 -17
  19. package/dist/federation/builder.test.js +7 -5
  20. package/dist/federation/collection.test.js +2 -3
  21. package/dist/federation/handler.test.js +110 -22
  22. package/dist/federation/idempotency.test.js +23 -22
  23. package/dist/federation/inbox.test.js +4 -3
  24. package/dist/federation/keycache.test.js +4 -4
  25. package/dist/federation/kv.test.js +56 -3
  26. package/dist/federation/middleware.test.js +95 -93
  27. package/dist/federation/mod.cjs +8 -10
  28. package/dist/federation/mod.d.cts +7 -12
  29. package/dist/federation/mod.d.ts +7 -12
  30. package/dist/federation/mod.js +8 -11
  31. package/dist/federation/mq.test.js +5 -4
  32. package/dist/federation/negotiation.test.js +2 -3
  33. package/dist/federation/retry.test.js +2 -3
  34. package/dist/federation/router.test.js +2 -2
  35. package/dist/federation/send.test.js +51 -9
  36. package/dist/{webfinger/handler.test.js → federation/webfinger.test.js} +24 -22
  37. package/dist/{federation-CRpdnOMS.cjs → federation-B431K2gm.cjs} +22 -0
  38. package/dist/{federation-jcR8-ZxP.js → federation-BbZwNNWj.js} +28 -6
  39. package/dist/{http-DmUiHemJ.js → http-B5BgMxiO.js} +119 -9
  40. package/dist/{http-DarlEN23.cjs → http-B_jtB30-.cjs} +132 -16
  41. package/dist/{http-M8k5mKc0.d.cts → http-ClB3pLcL.d.cts} +1 -1
  42. package/dist/{http-BbO0ejuk.d.ts → http-DLBDPal9.d.ts} +1 -1
  43. package/dist/{http-BIYwcgTd.js → http-uzkhnm0W.js} +3 -2
  44. package/dist/{inbox-Dbt8hLxb.js → inbox-CxrUTds4.js} +2 -1
  45. package/dist/{key-BcT6cdMK.js → key-DBHCloAO.js} +3 -3
  46. package/dist/{keycache-B8aIeTgt.js → keycache-DRxpZ5r9.js} +1 -1
  47. package/dist/{keys-Bs-0Hapk.js → keys-ZbcByPg9.js} +1 -1
  48. package/dist/{kv-Bxr0Q87_.d.cts → kv-B4vFhIYL.d.cts} +30 -1
  49. package/dist/{kv-BKNZ-Tb-.d.ts → kv-CYySNrsn.d.ts} +30 -1
  50. package/dist/{kv-CRZrzyXm.js → kv-QzKcOQgP.js} +22 -0
  51. package/dist/{kv-cache-DN9pfMBe.js → kv-cache-BEeqyGER.js} +14 -1
  52. package/dist/{kv-cache-B5TLf2fI.js → kv-cache-BqWqxam4.js} +2 -2
  53. package/dist/{kv-cache-BWWu8RyL.cjs → kv-cache-DY6hQ8Rf.cjs} +2 -2
  54. package/dist/{ld-DR6mmQjt.js → ld-CZgNIUGN.js} +4 -3
  55. package/dist/{middleware-B09KVcU4.cjs → middleware-BaoVtoMl.cjs} +210 -194
  56. package/dist/{middleware-B_rzGWsn.js → middleware-BqPcChYv.js} +164 -154
  57. package/dist/middleware-CnrWiFJI.cjs +12 -0
  58. package/dist/{middleware-Aqt52eK0.js → middleware-CxwWsgSo.js} +162 -165
  59. package/dist/middleware-DoFisLae.js +26 -0
  60. package/dist/middleware-ZN9cd_L8.js +12 -0
  61. package/dist/{mod-0noXw66R.d.cts → mod-0p9zUdzg.d.cts} +6 -6
  62. package/dist/mod-0qnPv4EC.d.cts +62 -0
  63. package/dist/{mod-DgdBYYa0.d.cts → mod-BrS8tiad.d.cts} +2 -2
  64. package/dist/mod-C3SOvTD1.d.ts +64 -0
  65. package/dist/{mod-DJcZDvjA.d.cts → mod-D6pS5_xJ.d.cts} +4 -4
  66. package/dist/{mod-B2iOw50L.d.ts → mod-jOa7W503.d.ts} +2 -2
  67. package/dist/{mod-BoHnwOCs.d.ts → mod-waqu-BL_.d.ts} +4 -4
  68. package/dist/{mod-B9M-8jm2.d.ts → mod-xc20HhMD.d.ts} +6 -6
  69. package/dist/mod.cjs +11 -93
  70. package/dist/mod.d.cts +11 -16
  71. package/dist/mod.d.ts +11 -16
  72. package/dist/mod.js +11 -15
  73. package/dist/nodeinfo/client.test.js +3 -4
  74. package/dist/nodeinfo/handler.test.js +22 -21
  75. package/dist/nodeinfo/mod.cjs +2 -2
  76. package/dist/nodeinfo/mod.d.cts +2 -2
  77. package/dist/nodeinfo/mod.d.ts +2 -2
  78. package/dist/nodeinfo/mod.js +2 -2
  79. package/dist/nodeinfo/types.test.js +2 -3
  80. package/dist/otel/exporter.test.js +893 -0
  81. package/dist/otel/mod.cjs +256 -0
  82. package/dist/otel/mod.d.cts +230 -0
  83. package/dist/otel/mod.d.ts +232 -0
  84. package/dist/otel/mod.js +255 -0
  85. package/dist/{owner-DEgLiB7Z.js → owner-BDvRiO5T.js} +44 -8
  86. package/dist/{owner-kQRGVXG1.d.ts → owner-BgI8C-VY.d.ts} +1 -2
  87. package/dist/{owner-B4HbyP8s.d.cts → owner-C-zfmVAD.d.cts} +1 -2
  88. package/dist/{proof-AhMjXzru.js → proof-DzFse-Bn.js} +46 -11
  89. package/dist/{proof-p3cmdfis.js → proof-XEPY5YKg.js} +3 -2
  90. package/dist/{proof-CbB_yXKu.cjs → proof-vmNsq1AQ.cjs} +63 -28
  91. package/dist/router-D9eI0s4b.js +118 -0
  92. package/dist/{send-CcKJ-npK.js → send-BdhhZ2MN.js} +9 -4
  93. package/dist/sig/http.test.js +6 -7
  94. package/dist/sig/key.test.js +5 -5
  95. package/dist/sig/ld.test.js +6 -6
  96. package/dist/sig/mod.cjs +3 -5
  97. package/dist/sig/mod.d.cts +3 -5
  98. package/dist/sig/mod.d.ts +3 -5
  99. package/dist/sig/mod.js +3 -5
  100. package/dist/sig/owner.test.js +29 -6
  101. package/dist/sig/proof.test.js +6 -6
  102. package/dist/testing/mod.d.ts +70 -6999
  103. package/dist/testing/mod.js +4 -3
  104. package/dist/{transformers-CoBS-oFG.cjs → transformers-BjBg6Lag.cjs} +2 -2
  105. package/dist/{transformers-BFT6d7J5.js → transformers-N_ip_y4P.js} +2 -2
  106. package/dist/{types-BtUjyi5y.js → types-8l28uC8o.js} +30 -25
  107. package/dist/{types-CWgzGaqk.cjs → types-B6z6CqIz.cjs} +30 -25
  108. package/dist/{types-C2XVl6gj.js → types-CPz01LGH.js} +3 -3
  109. package/dist/utils/docloader.test.js +7 -8
  110. package/dist/utils/kv-cache.test.js +5 -3
  111. package/dist/utils/mod.cjs +3 -5
  112. package/dist/utils/mod.d.cts +3 -4
  113. package/dist/utils/mod.d.ts +3 -4
  114. package/dist/utils/mod.js +3 -5
  115. package/package.json +25 -67
  116. package/dist/actor-BQuDqoKQ.cjs +0 -42079
  117. package/dist/actor-CmPnJ0G7.js +0 -146
  118. package/dist/actor-CtTW_fTc.js +0 -41647
  119. package/dist/actor-DqFajh9s.d.ts +0 -130
  120. package/dist/actor-f2NtjyCg.d.cts +0 -128
  121. package/dist/denokv-CCssOzMJ.js +0 -57
  122. package/dist/fixtures/activitypub.academy/users/brauca_darradiul.json +0 -83
  123. package/dist/fixtures/example.com/announce.json +0 -6
  124. package/dist/fixtures/example.com/collection.json +0 -19
  125. package/dist/fixtures/example.com/create.json +0 -6
  126. package/dist/fixtures/example.com/cross-origin-actor.json +0 -6
  127. package/dist/fixtures/example.com/hong-gildong.json +0 -11
  128. package/dist/fixtures/example.com/invite.json +0 -7
  129. package/dist/fixtures/example.com/key.json +0 -7
  130. package/dist/fixtures/example.com/key2.json +0 -6
  131. package/dist/fixtures/example.com/object.json +0 -6
  132. package/dist/fixtures/example.com/orderedcollectionpage.json +0 -24
  133. package/dist/fixtures/example.com/paged/a.json +0 -13
  134. package/dist/fixtures/example.com/paged/b.json +0 -16
  135. package/dist/fixtures/example.com/paged-collection.json +0 -6
  136. package/dist/fixtures/example.com/person.json +0 -22
  137. package/dist/fixtures/example.com/person2.json +0 -40
  138. package/dist/fixtures/example.com/test.json +0 -5
  139. package/dist/fixtures/example.com/users/handle.json +0 -16
  140. package/dist/fixtures/example.com/wrong-type.json +0 -3
  141. package/dist/fixtures/media.example.com/avatars/test-avatar.jpg.json +0 -6
  142. package/dist/fixtures/oeee.cafe/ap/users/3609fd4e-d51d-4db8-9f04-4189815864dd.json +0 -24
  143. package/dist/fixtures/remote.domain/users/bob.json +0 -20
  144. package/dist/fixtures/server.example/users/alice.json +0 -20
  145. package/dist/fixtures/w3id.org/identity/v1.json +0 -152
  146. package/dist/fixtures/w3id.org/security/data-integrity/v1.json +0 -74
  147. package/dist/fixtures/w3id.org/security/multikey/v1.json +0 -35
  148. package/dist/fixtures/w3id.org/security/v1.json +0 -50
  149. package/dist/fixtures/wizard.casa/users/hongminhee.json +0 -69
  150. package/dist/fixtures/www.w3.org/ns/activitystreams.json +0 -379
  151. package/dist/fixtures/www.w3.org/ns/did/v1.json +0 -58
  152. package/dist/lookup-Bhv7efZB.js +0 -42183
  153. package/dist/lookup-DdpqU9Gb.js +0 -258
  154. package/dist/lookup-EHJhdA8l.cjs +0 -270
  155. package/dist/middleware-C_Sa9J23.cjs +0 -15
  156. package/dist/middleware-DGwP3i-w.js +0 -15
  157. package/dist/middleware-Xyxj43cy.js +0 -26
  158. package/dist/mod-BlVovdcy.d.ts +0 -309
  159. package/dist/mod-BxRCHTz-.d.cts +0 -307
  160. package/dist/mod-C2tOeRkN.d.cts +0 -1
  161. package/dist/mod-C58MZ7Wx.d.cts +0 -113
  162. package/dist/mod-Ds0mpFZU.d.ts +0 -115
  163. package/dist/mod-xIj-IT58.d.ts +0 -2
  164. package/dist/mq-CUKlBw08.d.ts +0 -143
  165. package/dist/mq-DcJPkXD5.d.cts +0 -140
  166. package/dist/src/vocab/accept.yaml +0 -15
  167. package/dist/src/vocab/activity.yaml +0 -98
  168. package/dist/src/vocab/add.yaml +0 -16
  169. package/dist/src/vocab/announce.yaml +0 -30
  170. package/dist/src/vocab/application.yaml +0 -324
  171. package/dist/src/vocab/arrive.yaml +0 -15
  172. package/dist/src/vocab/article.yaml +0 -46
  173. package/dist/src/vocab/audio.yaml +0 -11
  174. package/dist/src/vocab/block.yaml +0 -16
  175. package/dist/src/vocab/chatmessage.yaml +0 -50
  176. package/dist/src/vocab/collection.yaml +0 -154
  177. package/dist/src/vocab/collectionpage.yaml +0 -55
  178. package/dist/src/vocab/create.yaml +0 -28
  179. package/dist/src/vocab/dataintegrityproof.yaml +0 -56
  180. package/dist/src/vocab/delete.yaml +0 -27
  181. package/dist/src/vocab/didservice.yaml +0 -22
  182. package/dist/src/vocab/dislike.yaml +0 -14
  183. package/dist/src/vocab/document.yaml +0 -31
  184. package/dist/src/vocab/emoji.yaml +0 -12
  185. package/dist/src/vocab/emojireact.yaml +0 -17
  186. package/dist/src/vocab/endpoints.yaml +0 -85
  187. package/dist/src/vocab/event.yaml +0 -11
  188. package/dist/src/vocab/export.yaml +0 -9
  189. package/dist/src/vocab/flag.yaml +0 -15
  190. package/dist/src/vocab/follow.yaml +0 -19
  191. package/dist/src/vocab/group.yaml +0 -324
  192. package/dist/src/vocab/hashtag.yaml +0 -14
  193. package/dist/src/vocab/ignore.yaml +0 -14
  194. package/dist/src/vocab/image.yaml +0 -9
  195. package/dist/src/vocab/intransitiveactivity.yaml +0 -15
  196. package/dist/src/vocab/invite.yaml +0 -14
  197. package/dist/src/vocab/join.yaml +0 -14
  198. package/dist/src/vocab/key.yaml +0 -28
  199. package/dist/src/vocab/leave.yaml +0 -14
  200. package/dist/src/vocab/like.yaml +0 -16
  201. package/dist/src/vocab/link.yaml +0 -101
  202. package/dist/src/vocab/listen.yaml +0 -12
  203. package/dist/src/vocab/mention.yaml +0 -9
  204. package/dist/src/vocab/move.yaml +0 -15
  205. package/dist/src/vocab/multikey.yaml +0 -36
  206. package/dist/src/vocab/note.yaml +0 -48
  207. package/dist/src/vocab/object.yaml +0 -404
  208. package/dist/src/vocab/offer.yaml +0 -15
  209. package/dist/src/vocab/orderedcollection.yaml +0 -39
  210. package/dist/src/vocab/orderedcollectionpage.yaml +0 -50
  211. package/dist/src/vocab/organization.yaml +0 -324
  212. package/dist/src/vocab/page.yaml +0 -11
  213. package/dist/src/vocab/person.yaml +0 -324
  214. package/dist/src/vocab/place.yaml +0 -75
  215. package/dist/src/vocab/profile.yaml +0 -26
  216. package/dist/src/vocab/propertyvalue.yaml +0 -32
  217. package/dist/src/vocab/question.yaml +0 -103
  218. package/dist/src/vocab/read.yaml +0 -13
  219. package/dist/src/vocab/reject.yaml +0 -14
  220. package/dist/src/vocab/relationship.yaml +0 -52
  221. package/dist/src/vocab/remove.yaml +0 -14
  222. package/dist/src/vocab/service.yaml +0 -324
  223. package/dist/src/vocab/source.yaml +0 -26
  224. package/dist/src/vocab/tentativeaccept.yaml +0 -14
  225. package/dist/src/vocab/tentativereject.yaml +0 -14
  226. package/dist/src/vocab/tombstone.yaml +0 -24
  227. package/dist/src/vocab/travel.yaml +0 -16
  228. package/dist/src/vocab/undo.yaml +0 -26
  229. package/dist/src/vocab/update.yaml +0 -58
  230. package/dist/src/vocab/video.yaml +0 -11
  231. package/dist/src/vocab/view.yaml +0 -13
  232. package/dist/testing/docloader.test.js +0 -22
  233. package/dist/vocab/actor.test.js +0 -5963
  234. package/dist/vocab/lookup.test.d.ts +0 -3
  235. package/dist/vocab/lookup.test.js +0 -454
  236. package/dist/vocab/mod.cjs +0 -86
  237. package/dist/vocab/mod.d.cts +0 -4
  238. package/dist/vocab/mod.d.ts +0 -6
  239. package/dist/vocab/mod.js +0 -9
  240. package/dist/vocab/type.test.d.ts +0 -3
  241. package/dist/vocab/type.test.js +0 -24
  242. package/dist/vocab/vocab.test.d.ts +0 -3
  243. package/dist/vocab/vocab.test.js +0 -9397
  244. package/dist/vocab-BCWe1Ih5.d.ts +0 -14905
  245. package/dist/vocab-CeDBzu-f.d.cts +0 -14903
  246. package/dist/vocab-CuAJ4Tbh.js +0 -255
  247. package/dist/vocab-DCYaqGPG.cjs +0 -291
  248. package/dist/webfinger/handler.test.d.ts +0 -3
  249. package/dist/webfinger/lookup.test.d.ts +0 -3
  250. package/dist/webfinger/lookup.test.js +0 -193
  251. package/dist/webfinger/mod.cjs +0 -8
  252. package/dist/webfinger/mod.d.cts +0 -2
  253. package/dist/webfinger/mod.d.ts +0 -4
  254. package/dist/webfinger/mod.js +0 -8
  255. package/dist/webfinger-C72Y8lrh.js +0 -4
  256. package/dist/webfinger-vAtLmxOF.cjs +0 -4
  257. package/dist/x/cfworkers.cjs +0 -100
  258. package/dist/x/cfworkers.d.cts +0 -59
  259. package/dist/x/cfworkers.d.ts +0 -61
  260. package/dist/x/cfworkers.js +0 -98
  261. package/dist/x/cfworkers.test.d.ts +0 -3
  262. package/dist/x/cfworkers.test.js +0 -177
  263. package/dist/x/hono.cjs +0 -61
  264. package/dist/x/hono.d.cts +0 -53
  265. package/dist/x/hono.d.ts +0 -55
  266. package/dist/x/hono.js +0 -60
  267. package/dist/x/sveltekit.cjs +0 -69
  268. package/dist/x/sveltekit.d.cts +0 -45
  269. package/dist/x/sveltekit.d.ts +0 -47
  270. package/dist/x/sveltekit.js +0 -68
  271. /package/dist/{collection-BzWsN9pB.js → collection-CcnIw1qY.js} +0 -0
  272. /package/dist/{testing/docloader.test.d.ts → federation/webfinger.test.d.ts} +0 -0
  273. /package/dist/{mod-CVgZgliM.d.ts → mod-1E3W847c.d.ts} +0 -0
  274. /package/dist/{mod-B-hUPT2N.d.cts → mod-C81L6_lQ.d.cts} +0 -0
  275. /package/dist/{negotiation-C4nFufNk.js → negotiation-5NPJL6zp.js} +0 -0
  276. /package/dist/{nodeinfo-BnthBobC.js → nodeinfo-BlLsRSiT.js} +0 -0
  277. /package/dist/{nodeinfo-CdN0rEnZ.cjs → nodeinfo-DuMYTpbZ.cjs} +0 -0
  278. /package/dist/{vocab/actor.test.d.ts → otel/exporter.test.d.ts} +0 -0
  279. /package/dist/{retry-CfF8Gn4d.js → retry-D4GJ670a.js} +0 -0
  280. /package/dist/{sig-C34-oHBl.js → sig-CwuONEzF.js} +0 -0
  281. /package/dist/{sig-YYj5tCnr.cjs → sig-DeXX2xnj.cjs} +0 -0
  282. /package/dist/{utils-DyRU1gdZ.cjs → utils-Db0ZmjcD.cjs} +0 -0
  283. /package/dist/{utils-D-Va7aXC.js → utils-Wranxuoe.js} +0 -0
@@ -3,7 +3,8 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import "../lookup-Bhv7efZB.js";
7
- import { createInboxContext, createRequestContext, test, testDefinitions } from "../testing-CW4N8vgf.js";
6
+ import { testDefinitions } from "../dist-B5f6a8Tt.js";
7
+ import "../router-D9eI0s4b.js";
8
+ import { createInboxContext, createRequestContext } from "../context-Bns6uTJq.js";
8
9
 
9
- export { createInboxContext, createRequestContext, test, testDefinitions };
10
+ export { createInboxContext, createRequestContext, testDefinitions };
@@ -41,7 +41,7 @@ function autoIdAssigner(activity, context) {
41
41
  * activity like this:
42
42
  *
43
43
  * ```typescript
44
- * import { Follow, Person } from "@fedify/fedify/vocab";
44
+ * import { Follow, Person } from "@fedify/vocab";
45
45
  * const input = new Follow({
46
46
  * id: new URL("http://example.com/activities/1"),
47
47
  * actor: new Person({
@@ -60,7 +60,7 @@ function autoIdAssigner(activity, context) {
60
60
  * The result of applying this transformer would be:
61
61
  *
62
62
  * ```typescript
63
- * import { Follow, Person } from "@fedify/fedify/vocab";
63
+ * import { Follow, Person } from "@fedify/vocab";
64
64
  * const output = new Follow({
65
65
  * id: new URL("http://example.com/activities/1"),
66
66
  * actor: new URL("http://example.com/actors/1"),
@@ -40,7 +40,7 @@ function autoIdAssigner(activity, context) {
40
40
  * activity like this:
41
41
  *
42
42
  * ```typescript
43
- * import { Follow, Person } from "@fedify/fedify/vocab";
43
+ * import { Follow, Person } from "@fedify/vocab";
44
44
  * const input = new Follow({
45
45
  * id: new URL("http://example.com/activities/1"),
46
46
  * actor: new Person({
@@ -59,7 +59,7 @@ function autoIdAssigner(activity, context) {
59
59
  * The result of applying this transformer would be:
60
60
  *
61
61
  * ```typescript
62
- * import { Follow, Person } from "@fedify/fedify/vocab";
62
+ * import { Follow, Person } from "@fedify/vocab";
63
63
  * const output = new Follow({
64
64
  * id: new URL("http://example.com/activities/1"),
65
65
  * actor: new URL("http://example.com/actors/1"),
@@ -110,15 +110,14 @@ function parseNodeInfo(data, options = {}) {
110
110
  if (typeof data.metadata === "object" && data.metadata != null) metadata = Object.fromEntries(Object.entries(data.metadata));
111
111
  else if (!options.tryBestEffort) return null;
112
112
  }
113
- const result = {
113
+ return {
114
114
  software,
115
115
  protocols,
116
- usage
116
+ usage,
117
+ ...services != null && { services },
118
+ ...openRegistrations != null && { openRegistrations },
119
+ ...metadata != null && { metadata }
117
120
  };
118
- if (services != null) result.services = services;
119
- if (openRegistrations != null) result.openRegistrations = openRegistrations;
120
- if (metadata != null) result.metadata = metadata;
121
- return result;
122
121
  }
123
122
  function parseSoftware(data, options = {}) {
124
123
  if (typeof data !== "object" || data == null) {
@@ -154,13 +153,12 @@ function parseSoftware(data, options = {}) {
154
153
  }
155
154
  else if (!options.tryBestEffort) return null;
156
155
  }
157
- const result = {
156
+ return {
158
157
  name,
159
- version
158
+ version,
159
+ ...repository != null && { repository },
160
+ ...homepage != null && { homepage }
160
161
  };
161
- if (repository != null) result.repository = repository;
162
- if (homepage != null) result.homepage = homepage;
163
- return result;
164
162
  }
165
163
  function parseProtocol(data) {
166
164
  if (data === "activitypub" || data === "buddycloud" || data === "dfrn" || data === "diaspora" || data === "libertree" || data === "ostatus" || data === "pumpio" || data === "tent" || data === "xmpp" || data === "zot") return data;
@@ -183,10 +181,10 @@ function parseServices(data, options = {}) {
183
181
  outbound = os.filter((o) => o != null);
184
182
  if (os.length > outbound.length && !options.tryBestEffort) return null;
185
183
  }
186
- const result = {};
187
- if (inbound != null) result.inbound = inbound;
188
- if (outbound != null) result.outbound = outbound;
189
- return result;
184
+ return {
185
+ ...inbound != null && { inbound },
186
+ ...outbound != null && { outbound }
187
+ };
190
188
  }
191
189
  function parseInboundService(data) {
192
190
  if (data === "atom1.0" || data === "gnusocial" || data === "imap" || data === "pnut" || data === "pop3" || data === "pumpio" || data === "rss2.0" || data === "twitter") return data;
@@ -198,33 +196,40 @@ function parseOutboundService(data) {
198
196
  }
199
197
  function parseUsage(data, options = {}) {
200
198
  if (typeof data !== "object" || data == null) return null;
201
- const users = {};
199
+ let total;
200
+ let activeHalfyear;
201
+ let activeMonth;
202
202
  if ("users" in data && typeof data.users === "object" && data.users != null) {
203
- if ("total" in data.users) if (typeof data.users.total === "number") users.total = data.users.total;
203
+ if ("total" in data.users) if (typeof data.users.total === "number") total = data.users.total;
204
204
  else {
205
205
  if (!options.tryBestEffort) return null;
206
206
  if (typeof data.users.total === "string") {
207
207
  const n = parseInt(data.users.total);
208
- if (!isNaN(n)) users.total = n;
208
+ if (!isNaN(n)) total = n;
209
209
  }
210
210
  }
211
- if ("activeHalfyear" in data.users) if (typeof data.users.activeHalfyear === "number") users.activeHalfyear = data.users.activeHalfyear;
211
+ if ("activeHalfyear" in data.users) if (typeof data.users.activeHalfyear === "number") activeHalfyear = data.users.activeHalfyear;
212
212
  else {
213
213
  if (!options.tryBestEffort) return null;
214
214
  if (typeof data.users.activeHalfyear === "string") {
215
215
  const n = parseInt(data.users.activeHalfyear);
216
- if (!isNaN(n)) users.activeHalfyear = n;
216
+ if (!isNaN(n)) activeHalfyear = n;
217
217
  }
218
218
  }
219
- if ("activeMonth" in data.users) if (typeof data.users.activeMonth === "number") users.activeMonth = data.users.activeMonth;
219
+ if ("activeMonth" in data.users) if (typeof data.users.activeMonth === "number") activeMonth = data.users.activeMonth;
220
220
  else {
221
221
  if (!options.tryBestEffort) return null;
222
222
  if (typeof data.users.activeMonth === "string") {
223
223
  const n = parseInt(data.users.activeMonth);
224
- if (!isNaN(n)) users.activeMonth = n;
224
+ if (!isNaN(n)) activeMonth = n;
225
225
  }
226
226
  }
227
227
  } else if (!options.tryBestEffort) return null;
228
+ const users = {
229
+ ...total != null && { total },
230
+ ...activeHalfyear != null && { activeHalfyear },
231
+ ...activeMonth != null && { activeMonth }
232
+ };
228
233
  let localPosts = 0;
229
234
  if ("localPosts" in data) if (typeof data.localPosts === "number") localPosts = data.localPosts;
230
235
  else {
@@ -275,13 +280,13 @@ function nodeInfoToJson(nodeInfo) {
275
280
  repository: nodeInfo.software.repository?.href,
276
281
  homepage: nodeInfo.software.homepage?.href
277
282
  },
278
- protocols: nodeInfo.protocols,
283
+ protocols: [...nodeInfo.protocols],
279
284
  services: nodeInfo.services == null ? {
280
285
  inbound: [],
281
286
  outbound: []
282
287
  } : {
283
- inbound: nodeInfo.services.inbound ?? [],
284
- outbound: nodeInfo.services.outbound ?? []
288
+ inbound: nodeInfo.services.inbound ? [...nodeInfo.services.inbound] : [],
289
+ outbound: nodeInfo.services.outbound ? [...nodeInfo.services.outbound] : []
285
290
  },
286
291
  openRegistrations: nodeInfo.openRegistrations ?? false,
287
292
  usage: {
@@ -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 {
@@ -276,13 +281,13 @@ function nodeInfoToJson(nodeInfo) {
276
281
  repository: nodeInfo.software.repository?.href,
277
282
  homepage: nodeInfo.software.homepage?.href
278
283
  },
279
- protocols: nodeInfo.protocols,
284
+ protocols: [...nodeInfo.protocols],
280
285
  services: nodeInfo.services == null ? {
281
286
  inbound: [],
282
287
  outbound: []
283
288
  } : {
284
- inbound: nodeInfo.services.inbound ?? [],
285
- outbound: nodeInfo.services.outbound ?? []
289
+ inbound: nodeInfo.services.inbound ? [...nodeInfo.services.inbound] : [],
290
+ outbound: nodeInfo.services.outbound ? [...nodeInfo.services.outbound] : []
286
291
  },
287
292
  openRegistrations: nodeInfo.openRegistrations ?? false,
288
293
  usage: {
@@ -27,13 +27,13 @@ function nodeInfoToJson(nodeInfo) {
27
27
  repository: nodeInfo.software.repository?.href,
28
28
  homepage: nodeInfo.software.homepage?.href
29
29
  },
30
- protocols: nodeInfo.protocols,
30
+ protocols: [...nodeInfo.protocols],
31
31
  services: nodeInfo.services == null ? {
32
32
  inbound: [],
33
33
  outbound: []
34
34
  } : {
35
- inbound: nodeInfo.services.inbound ?? [],
36
- outbound: nodeInfo.services.outbound ?? []
35
+ inbound: nodeInfo.services.inbound ? [...nodeInfo.services.inbound] : [],
36
+ outbound: nodeInfo.services.outbound ? [...nodeInfo.services.outbound] : []
37
37
  },
38
38
  openRegistrations: nodeInfo.openRegistrations ?? false,
39
39
  usage: {
@@ -3,21 +3,20 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import "../lookup-Bhv7efZB.js";
6
+ import { mockDocumentLoader, test } from "../dist-B5f6a8Tt.js";
7
7
  import { assertEquals } from "../assert_equals-DSbWqCm3.js";
8
8
  import "../assert-MZs1qjMx.js";
9
9
  import "../assert_instance_of-DHz7EHNU.js";
10
- import "../actor-CmPnJ0G7.js";
11
- import "../key-BcT6cdMK.js";
12
- import { verifyRequest } from "../http-BIYwcgTd.js";
13
- import { getAuthenticatedDocumentLoader } from "../docloader-BkhI_RcC.js";
14
- import { mockDocumentLoader, test } from "../testing-CW4N8vgf.js";
10
+ import "../deno-i60L3ZJW.js";
11
+ import "../key-DBHCloAO.js";
12
+ import { verifyRequest } from "../http-uzkhnm0W.js";
13
+ import { getAuthenticatedDocumentLoader } from "../docloader-BuOglEYx.js";
15
14
  import "../std__assert-DWivtrGR.js";
16
15
  import { assertRejects } from "../assert_rejects-Ce45JcFg.js";
17
16
  import "../assert_throws-BNXdRGWP.js";
18
17
  import "../assert_not_equals-C80BG-_5.js";
19
- import { rsaPrivateKey2 } from "../keys-Bs-0Hapk.js";
20
- import { esm_default } from "../esm-DOqAYjlY.js";
18
+ import { rsaPrivateKey2 } from "../keys-ZbcByPg9.js";
19
+ import { esm_default } from "../esm-DGl7uK1r.js";
21
20
  import { UrlError } from "@fedify/vocab-runtime";
22
21
 
23
22
  //#region src/utils/docloader.test.ts
@@ -3,9 +3,8 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import "../lookup-Bhv7efZB.js";
7
- import { MockKvStore, kvCache } from "../kv-cache-DN9pfMBe.js";
8
- import { mockDocumentLoader, test } from "../testing-CW4N8vgf.js";
6
+ import { mockDocumentLoader, test } from "../dist-B5f6a8Tt.js";
7
+ import { MockKvStore, kvCache } from "../kv-cache-BEeqyGER.js";
9
8
  import { preloadedContexts } from "@fedify/vocab-runtime";
10
9
  import { deepStrictEqual, throws } from "node:assert";
11
10
 
@@ -125,6 +124,9 @@ test("kvCache()", async (t) => {
125
124
  delete(_key) {
126
125
  throw new Error("Failed to delete key");
127
126
  }
127
+ async *list(_prefix) {
128
+ throw new Error("Failed to list keys");
129
+ }
128
130
  }
129
131
  const loader = kvCache({
130
132
  kv: new KvStoreThrowsException(),
@@ -2,11 +2,9 @@
2
2
  const { Temporal } = require("@js-temporal/polyfill");
3
3
  const { URLPattern } = require("urlpattern-polyfill");
4
4
 
5
- require('../lookup-EHJhdA8l.cjs');
6
- require('../actor-BQuDqoKQ.cjs');
7
- require('../http-DarlEN23.cjs');
8
- const require_kv_cache = require('../kv-cache-BWWu8RyL.cjs');
9
- require('../utils-DyRU1gdZ.cjs');
5
+ require('../http-B_jtB30-.cjs');
6
+ const require_kv_cache = require('../kv-cache-DY6hQ8Rf.cjs');
7
+ require('../utils-Db0ZmjcD.cjs');
10
8
 
11
9
  exports.getAuthenticatedDocumentLoader = require_kv_cache.getAuthenticatedDocumentLoader;
12
10
  exports.kvCache = require_kv_cache.kvCache;
@@ -1,5 +1,4 @@
1
- import "../vocab-CeDBzu-f.cjs";
2
- import "../http-M8k5mKc0.cjs";
3
- import "../kv-Bxr0Q87_.cjs";
4
- import { getAuthenticatedDocumentLoader, kvCache } from "../mod-0noXw66R.cjs";
1
+ import "../http-ClB3pLcL.cjs";
2
+ import "../kv-B4vFhIYL.cjs";
3
+ import { getAuthenticatedDocumentLoader, kvCache } from "../mod-0p9zUdzg.cjs";
5
4
  export { getAuthenticatedDocumentLoader, kvCache };
@@ -1,7 +1,6 @@
1
1
  import { Temporal } from "@js-temporal/polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
- import "../vocab-BCWe1Ih5.js";
4
- import "../http-BbO0ejuk.js";
5
- import "../kv-BKNZ-Tb-.js";
6
- import { getAuthenticatedDocumentLoader, kvCache } from "../mod-B9M-8jm2.js";
3
+ import "../http-DLBDPal9.js";
4
+ import "../kv-CYySNrsn.js";
5
+ import { getAuthenticatedDocumentLoader, kvCache } from "../mod-xc20HhMD.js";
7
6
  export { getAuthenticatedDocumentLoader, kvCache };
package/dist/utils/mod.js CHANGED
@@ -2,10 +2,8 @@
2
2
  import { Temporal } from "@js-temporal/polyfill";
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
 
5
- import "../lookup-DdpqU9Gb.js";
6
- import "../actor-CtTW_fTc.js";
7
- import "../http-DmUiHemJ.js";
8
- import { getAuthenticatedDocumentLoader, kvCache } from "../kv-cache-B5TLf2fI.js";
9
- import "../utils-D-Va7aXC.js";
5
+ import "../http-B5BgMxiO.js";
6
+ import { getAuthenticatedDocumentLoader, kvCache } from "../kv-cache-BqWqxam4.js";
7
+ import "../utils-Wranxuoe.js";
10
8
 
11
9
  export { getAuthenticatedDocumentLoader, kvCache };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fedify/fedify",
3
- "version": "2.0.0-dev.1875+d712d60c",
3
+ "version": "2.0.0-dev.196+c3cfc0a9",
4
4
  "description": "An ActivityPub server framework",
5
5
  "keywords": [
6
6
  "ActivityPub",
@@ -78,6 +78,16 @@
78
78
  "require": "./dist/nodeinfo/mod.cjs",
79
79
  "default": "./dist/nodeinfo/mod.js"
80
80
  },
81
+ "./otel": {
82
+ "types": {
83
+ "import": "./dist/otel/mod.d.ts",
84
+ "require": "./dist/otel/mod.d.cts",
85
+ "default": "./dist/otel/mod.d.ts"
86
+ },
87
+ "import": "./dist/otel/mod.js",
88
+ "require": "./dist/otel/mod.cjs",
89
+ "default": "./dist/otel/mod.js"
90
+ },
81
91
  "./sig": {
82
92
  "types": {
83
93
  "import": "./dist/sig/mod.d.ts",
@@ -97,98 +107,46 @@
97
107
  "import": "./dist/utils/mod.js",
98
108
  "require": "./dist/utils/mod.cjs",
99
109
  "default": "./dist/utils/mod.js"
100
- },
101
- "./vocab": {
102
- "types": {
103
- "import": "./dist/vocab/mod.d.ts",
104
- "require": "./dist/vocab/mod.d.cts",
105
- "default": "./dist/vocab/mod.d.ts"
106
- },
107
- "import": "./dist/vocab/mod.js",
108
- "require": "./dist/vocab/mod.cjs",
109
- "default": "./dist/vocab/mod.js"
110
- },
111
- "./webfinger": {
112
- "types": {
113
- "import": "./dist/webfinger/mod.d.ts",
114
- "require": "./dist/webfinger/mod.d.cts",
115
- "default": "./dist/webfinger/mod.d.ts"
116
- },
117
- "import": "./dist/webfinger/mod.js",
118
- "require": "./dist/webfinger/mod.cjs",
119
- "default": "./dist/webfinger/mod.js"
120
- },
121
- "./x/cfworkers": {
122
- "types": {
123
- "import": "./dist/x/cfworkers.d.ts",
124
- "require": "./dist/x/cfworkers.d.cts",
125
- "default": "./dist/x/cfworkers.d.ts"
126
- },
127
- "import": "./dist/x/cfworkers.js",
128
- "require": "./dist/x/cfworkers.cjs",
129
- "default": "./dist/x/cfworkers.js"
130
- },
131
- "./x/hono": {
132
- "types": {
133
- "import": "./dist/x/hono.d.ts",
134
- "require": "./dist/x/hono.d.cts",
135
- "default": "./dist/x/hono.d.ts"
136
- },
137
- "import": "./dist/x/hono.js",
138
- "require": "./dist/x/hono.cjs",
139
- "default": "./dist/x/hono.js"
140
- },
141
- "./x/sveltekit": {
142
- "types": {
143
- "import": "./dist/x/sveltekit.d.ts",
144
- "require": "./dist/x/sveltekit.d.cts",
145
- "default": "./dist/x/sveltekit.d.ts"
146
- },
147
- "import": "./dist/x/sveltekit.js",
148
- "require": "./dist/x/sveltekit.cjs",
149
- "default": "./dist/x/sveltekit.js"
150
110
  }
151
111
  },
152
112
  "dependencies": {
153
113
  "@js-temporal/polyfill": "^0.5.1",
154
- "@logtape/logtape": "^1.1.1",
155
- "@multiformats/base-x": "^4.0.1",
114
+ "@logtape/logtape": "^2.0.0",
156
115
  "@opentelemetry/api": "^1.9.0",
116
+ "@opentelemetry/core": "^2.0.0",
117
+ "@opentelemetry/sdk-trace-base": "^2.0.0",
157
118
  "@opentelemetry/semantic-conventions": "^1.27.0",
158
- "asn1js": "^3.0.5",
159
119
  "byte-encodings": "^1.0.11",
160
- "es-toolkit": "^1.39.5",
120
+ "es-toolkit": "1.43.0",
161
121
  "json-canon": "^1.0.1",
162
- "jsonld": "^8.3.2",
122
+ "jsonld": "^9.0.0",
163
123
  "multicodec": "^3.2.1",
164
- "pkijs": "^3.2.4",
165
124
  "structured-field-values": "^2.0.4",
166
125
  "uri-template-router": "^1.0.0",
167
126
  "url-template": "^3.1.1",
168
127
  "urlpattern-polyfill": "^10.1.0",
169
- "@fedify/vocab-runtime": "2.0.0-dev.1875+d712d60c"
128
+ "@fedify/vocab": "2.0.0-dev.196+c3cfc0a9",
129
+ "@fedify/webfinger": "2.0.0-dev.196+c3cfc0a9",
130
+ "@fedify/vocab-runtime": "2.0.0-dev.196+c3cfc0a9"
170
131
  },
171
132
  "devDependencies": {
172
- "@cloudflare/workers-types": "^4.20250529.0",
173
133
  "@std/assert": "npm:@jsr/std__assert@^0.226.0",
174
134
  "@std/path": "npm:@jsr/std__path@^1.0.6",
175
- "@std/url": "npm:@jsr/std__url@1.0.0-rc.3",
176
- "@std/yaml": "npm:@jsr/std__yaml@^1.0.6",
177
135
  "@types/node": "^24.2.1",
178
- "fast-check": "^3.22.0",
179
136
  "fetch-mock": "^12.5.4",
180
137
  "miniflare": "^4.20250523.0",
181
138
  "tsdown": "^0.12.9",
182
139
  "tsx": "^4.19.4",
183
140
  "typescript": "^5.9.3",
184
141
  "wrangler": "^4.17.0",
185
- "@fedify/vocab-tools": "^2.0.0-dev.1875+d712d60c"
142
+ "@fedify/vocab-tools": "^2.0.0-dev.196+c3cfc0a9",
143
+ "@fedify/fixture": "2.0.0"
186
144
  },
187
145
  "scripts": {
188
- "build": "deno task codegen && pnpm run --filter vocab-runtime build && pnpm run --filter vocab-tools build && tsdown",
189
- "prepublish": "pnpm run build",
190
- "test": "deno task codegen && tsdown && cd dist/ && node --test",
191
- "test:bun": "deno task codegen && deno task pnpm:build-vocab && tsdown && cd dist/ && bun test --timeout 60000",
146
+ "build": "tsdown",
147
+ "prepublish": "tsdown",
148
+ "test": "tsdown && cd dist/ && node --test",
149
+ "test:bun": "tsdown && cd dist/ && bun test --timeout 60000",
192
150
  "test:cfworkers": "deno task codegen && wrangler deploy --dry-run --outdir src/cfworkers && node --import=tsx src/cfworkers/client.ts"
193
151
  }
194
152
  }