@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
@@ -1,258 +0,0 @@
1
-
2
- import { Temporal } from "@js-temporal/polyfill";
3
- import { URLPattern } from "urlpattern-polyfill";
4
-
5
- import { getLogger } from "@logtape/logtape";
6
- import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
7
- import { UrlError, getUserAgent, validatePublicUrl } from "@fedify/vocab-runtime";
8
-
9
- //#region deno.json
10
- var name = "@fedify/fedify";
11
- var version = "2.0.0-dev.1875+d712d60c";
12
- var license = "MIT";
13
- var exports = {
14
- ".": "./src/mod.ts",
15
- "./compat": "./src/compat/mod.ts",
16
- "./federation": "./src/federation/mod.ts",
17
- "./nodeinfo": "./src/nodeinfo/mod.ts",
18
- "./sig": "./src/sig/mod.ts",
19
- "./testing": "./src/testing/mod.ts",
20
- "./vocab": "./src/vocab/mod.ts",
21
- "./utils": "./src/utils/mod.ts",
22
- "./webfinger": "./src/webfinger/mod.ts",
23
- "./x/cfworkers": "./src/x/cfworkers.ts",
24
- "./x/denokv": "./src/x/denokv.ts",
25
- "./x/fresh": "./src/x/fresh.ts",
26
- "./x/hono": "./src/x/hono.ts",
27
- "./x/sveltekit": "./src/x/sveltekit.ts"
28
- };
29
- var imports = {
30
- "@multiformats/base-x": "npm:@multiformats/base-x@^4.0.1",
31
- "@opentelemetry/api": "npm:@opentelemetry/api@^1.9.0",
32
- "@opentelemetry/semantic-conventions": "npm:@opentelemetry/semantic-conventions@^1.27.0",
33
- "@std/assert": "jsr:@std/assert@^0.226.0",
34
- "@std/url": "jsr:@std/url@^0.225.1",
35
- "asn1js": "npm:asn1js@^3.0.5",
36
- "es-toolkit": "jsr:@es-toolkit/es-toolkit@^1.39.5",
37
- "fast-check": "npm:fast-check@^3.22.0",
38
- "fetch-mock": "npm:fetch-mock@^12.5.2",
39
- "json-canon": "npm:json-canon@^1.0.1",
40
- "jsonld": "npm:jsonld@^8.3.2",
41
- "multicodec": "npm:multicodec@^3.2.1",
42
- "pkijs": "npm:pkijs@^3.2.4",
43
- "structured-field-values": "npm:structured-field-values@^2.0.4",
44
- "uri-template-router": "npm:uri-template-router@^1.0.0",
45
- "url-template": "npm:url-template@^3.1.1"
46
- };
47
- var include = ["src/vocab/vocab.ts"];
48
- var exclude = [
49
- ".test-report.xml",
50
- "apidoc/",
51
- "dist/",
52
- "node_modules/",
53
- "npm/",
54
- "pnpm-lock.yaml",
55
- "src/cfworkers/dist/",
56
- "src/cfworkers/fixtures/",
57
- "src/cfworkers/imports.ts",
58
- "src/cfworkers/README.md",
59
- "src/cfworkers/server.ts",
60
- "src/cfworkers/server.js",
61
- "src/cfworkers/server.js.map",
62
- "src/vocab/*.yaml",
63
- "!src/vocab/vocab.ts"
64
- ];
65
- var tasks = {
66
- "codegen": "deno run --allow-read --allow-write --allow-env --check scripts/codegen.ts && deno fmt src/vocab/vocab.ts && deno cache src/vocab/vocab.ts && deno check src/vocab/vocab.ts",
67
- "cache": {
68
- "command": "deno cache src/mod.ts",
69
- "dependencies": ["codegen"]
70
- },
71
- "check": {
72
- "command": "deno fmt --check && deno lint && deno check src/**/*.ts",
73
- "dependencies": ["codegen"]
74
- },
75
- "test": {
76
- "command": "deno test --check --doc --allow-read --allow-write --allow-env --unstable-kv --trace-leaks --parallel",
77
- "dependencies": ["codegen"]
78
- },
79
- "coverage": "deno task test --clean --coverage && deno coverage --html coverage",
80
- "bench": {
81
- "command": "deno bench --allow-read --allow-write --allow-net --allow-env --allow-run --unstable-kv",
82
- "dependencies": ["codegen"]
83
- },
84
- "apidoc": {
85
- "command": "deno doc --html --name=Fedify --output=apidoc/ src/mod.ts",
86
- "dependencies": ["codegen"]
87
- },
88
- "publish": {
89
- "command": "deno publish",
90
- "dependencies": ["codegen"]
91
- },
92
- "pnpm:install": "pnpm install --silent",
93
- "pnpm:build": {
94
- "command": "pnpm exec tsdown",
95
- "dependencies": [
96
- "codegen",
97
- "pnpm:install",
98
- "pnpm:build-vocab"
99
- ]
100
- },
101
- "pnpm:build-vocab-runtime": { "command": "cd ../vocab-runtime && pnpm build" },
102
- "pnpm:build-vocab-tools": { "command": "cd ../vocab-tools && pnpm build" },
103
- "pnpm:build-vocab": { "dependencies": ["pnpm:build-vocab-runtime", "pnpm:build-vocab-tools"] },
104
- "test:node": {
105
- "command": "cd dist/ && node --test",
106
- "dependencies": ["pnpm:build"]
107
- },
108
- "test:bun": {
109
- "command": "cd dist/ && bun test --timeout 60000",
110
- "dependencies": ["pnpm:build-vocab", "pnpm:build"]
111
- },
112
- "test:cfworkers": {
113
- "command": "pnpm exec wrangler deploy --dry-run --outdir src/cfworkers && node --import=tsx src/cfworkers/client.ts",
114
- "dependencies": ["pnpm:build-vocab", "pnpm:build"]
115
- },
116
- "test-all": { "dependencies": [
117
- "check",
118
- "test",
119
- "test:node",
120
- "test:bun",
121
- "test:cfworkers"
122
- ] }
123
- };
124
- var deno_default = {
125
- name,
126
- version,
127
- license,
128
- exports,
129
- imports,
130
- include,
131
- exclude,
132
- tasks
133
- };
134
-
135
- //#endregion
136
- //#region src/webfinger/lookup.ts
137
- const logger = getLogger([
138
- "fedify",
139
- "webfinger",
140
- "lookup"
141
- ]);
142
- const DEFAULT_MAX_REDIRECTION = 5;
143
- /**
144
- * Looks up a WebFinger resource.
145
- * @param resource The resource URL to look up.
146
- * @param options Extra options for looking up the resource.
147
- * @returns The resource descriptor, or `null` if not found.
148
- * @since 0.2.0
149
- */
150
- async function lookupWebFinger(resource, options = {}) {
151
- const tracerProvider = options.tracerProvider ?? trace.getTracerProvider();
152
- const tracer = tracerProvider.getTracer(deno_default.name, deno_default.version);
153
- return await tracer.startActiveSpan("webfinger.lookup", {
154
- kind: SpanKind.CLIENT,
155
- attributes: {
156
- "webfinger.resource": resource.toString(),
157
- "webfinger.resource.scheme": typeof resource === "string" ? resource.replace(/:.*$/, "") : resource.protocol.replace(/:$/, "")
158
- }
159
- }, async (span) => {
160
- try {
161
- const result = await lookupWebFingerInternal(resource, options);
162
- span.setStatus({ code: result === null ? SpanStatusCode.ERROR : SpanStatusCode.OK });
163
- return result;
164
- } catch (error) {
165
- span.setStatus({
166
- code: SpanStatusCode.ERROR,
167
- message: String(error)
168
- });
169
- throw error;
170
- } finally {
171
- span.end();
172
- }
173
- });
174
- }
175
- async function lookupWebFingerInternal(resource, options = {}) {
176
- if (typeof resource === "string") resource = new URL(resource);
177
- let protocol = "https:";
178
- let server;
179
- if (resource.protocol === "acct:") {
180
- const atPos = resource.pathname.lastIndexOf("@");
181
- if (atPos < 0) return null;
182
- server = resource.pathname.substring(atPos + 1);
183
- if (server === "") return null;
184
- } else {
185
- protocol = resource.protocol;
186
- server = resource.host;
187
- }
188
- let url = new URL(`${protocol}//${server}/.well-known/webfinger`);
189
- url.searchParams.set("resource", resource.href);
190
- let redirected = 0;
191
- while (true) {
192
- logger.debug("Fetching WebFinger resource descriptor from {url}...", { url: url.href });
193
- let response;
194
- if (options.allowPrivateAddress !== true) try {
195
- await validatePublicUrl(url.href);
196
- } catch (e) {
197
- if (e instanceof UrlError) {
198
- logger.error("Invalid URL for WebFinger resource descriptor: {error}", { error: e });
199
- return null;
200
- }
201
- throw e;
202
- }
203
- try {
204
- response = await fetch(url, {
205
- headers: {
206
- Accept: "application/jrd+json",
207
- "User-Agent": typeof options.userAgent === "string" ? options.userAgent : getUserAgent(options.userAgent)
208
- },
209
- redirect: "manual",
210
- signal: options.signal
211
- });
212
- } catch (error) {
213
- logger.debug("Failed to fetch WebFinger resource descriptor: {error}", {
214
- url: url.href,
215
- error
216
- });
217
- return null;
218
- }
219
- if (response.status >= 300 && response.status < 400 && response.headers.has("Location")) {
220
- redirected++;
221
- const maxRedirection = options.maxRedirection ?? DEFAULT_MAX_REDIRECTION;
222
- if (redirected >= maxRedirection) {
223
- logger.error("Too many redirections ({redirections}) while fetching WebFinger resource descriptor.", { redirections: redirected });
224
- return null;
225
- }
226
- const redirectedUrl = new URL(response.headers.get("Location"), response.url == null || response.url === "" ? url : response.url);
227
- if (redirectedUrl.protocol !== url.protocol) {
228
- logger.error("Redirected to a different protocol ({protocol} to {redirectedProtocol}) while fetching WebFinger resource descriptor.", {
229
- protocol: url.protocol,
230
- redirectedProtocol: redirectedUrl.protocol
231
- });
232
- return null;
233
- }
234
- url = redirectedUrl;
235
- continue;
236
- }
237
- if (!response.ok) {
238
- logger.debug("Failed to fetch WebFinger resource descriptor: {status} {statusText}.", {
239
- url: url.href,
240
- status: response.status,
241
- statusText: response.statusText
242
- });
243
- return null;
244
- }
245
- try {
246
- return await response.json();
247
- } catch (e) {
248
- if (e instanceof SyntaxError) {
249
- logger.debug("Failed to parse WebFinger resource descriptor as JSON: {error}", { error: e });
250
- return null;
251
- }
252
- throw e;
253
- }
254
- }
255
- }
256
-
257
- //#endregion
258
- export { deno_default, lookupWebFinger };
@@ -1,270 +0,0 @@
1
-
2
- const { Temporal } = require("@js-temporal/polyfill");
3
- const { URLPattern } = require("urlpattern-polyfill");
4
-
5
- const require_chunk = require('./chunk-DqRYRqnO.cjs');
6
- const __logtape_logtape = require_chunk.__toESM(require("@logtape/logtape"));
7
- const __opentelemetry_api = require_chunk.__toESM(require("@opentelemetry/api"));
8
- const __fedify_vocab_runtime = require_chunk.__toESM(require("@fedify/vocab-runtime"));
9
-
10
- //#region deno.json
11
- var name = "@fedify/fedify";
12
- var version = "2.0.0-dev.1875+d712d60c";
13
- var license = "MIT";
14
- var exports$1 = {
15
- ".": "./src/mod.ts",
16
- "./compat": "./src/compat/mod.ts",
17
- "./federation": "./src/federation/mod.ts",
18
- "./nodeinfo": "./src/nodeinfo/mod.ts",
19
- "./sig": "./src/sig/mod.ts",
20
- "./testing": "./src/testing/mod.ts",
21
- "./vocab": "./src/vocab/mod.ts",
22
- "./utils": "./src/utils/mod.ts",
23
- "./webfinger": "./src/webfinger/mod.ts",
24
- "./x/cfworkers": "./src/x/cfworkers.ts",
25
- "./x/denokv": "./src/x/denokv.ts",
26
- "./x/fresh": "./src/x/fresh.ts",
27
- "./x/hono": "./src/x/hono.ts",
28
- "./x/sveltekit": "./src/x/sveltekit.ts"
29
- };
30
- var imports = {
31
- "@multiformats/base-x": "npm:@multiformats/base-x@^4.0.1",
32
- "@opentelemetry/api": "npm:@opentelemetry/api@^1.9.0",
33
- "@opentelemetry/semantic-conventions": "npm:@opentelemetry/semantic-conventions@^1.27.0",
34
- "@std/assert": "jsr:@std/assert@^0.226.0",
35
- "@std/url": "jsr:@std/url@^0.225.1",
36
- "asn1js": "npm:asn1js@^3.0.5",
37
- "es-toolkit": "jsr:@es-toolkit/es-toolkit@^1.39.5",
38
- "fast-check": "npm:fast-check@^3.22.0",
39
- "fetch-mock": "npm:fetch-mock@^12.5.2",
40
- "json-canon": "npm:json-canon@^1.0.1",
41
- "jsonld": "npm:jsonld@^8.3.2",
42
- "multicodec": "npm:multicodec@^3.2.1",
43
- "pkijs": "npm:pkijs@^3.2.4",
44
- "structured-field-values": "npm:structured-field-values@^2.0.4",
45
- "uri-template-router": "npm:uri-template-router@^1.0.0",
46
- "url-template": "npm:url-template@^3.1.1"
47
- };
48
- var include = ["src/vocab/vocab.ts"];
49
- var exclude = [
50
- ".test-report.xml",
51
- "apidoc/",
52
- "dist/",
53
- "node_modules/",
54
- "npm/",
55
- "pnpm-lock.yaml",
56
- "src/cfworkers/dist/",
57
- "src/cfworkers/fixtures/",
58
- "src/cfworkers/imports.ts",
59
- "src/cfworkers/README.md",
60
- "src/cfworkers/server.ts",
61
- "src/cfworkers/server.js",
62
- "src/cfworkers/server.js.map",
63
- "src/vocab/*.yaml",
64
- "!src/vocab/vocab.ts"
65
- ];
66
- var tasks = {
67
- "codegen": "deno run --allow-read --allow-write --allow-env --check scripts/codegen.ts && deno fmt src/vocab/vocab.ts && deno cache src/vocab/vocab.ts && deno check src/vocab/vocab.ts",
68
- "cache": {
69
- "command": "deno cache src/mod.ts",
70
- "dependencies": ["codegen"]
71
- },
72
- "check": {
73
- "command": "deno fmt --check && deno lint && deno check src/**/*.ts",
74
- "dependencies": ["codegen"]
75
- },
76
- "test": {
77
- "command": "deno test --check --doc --allow-read --allow-write --allow-env --unstable-kv --trace-leaks --parallel",
78
- "dependencies": ["codegen"]
79
- },
80
- "coverage": "deno task test --clean --coverage && deno coverage --html coverage",
81
- "bench": {
82
- "command": "deno bench --allow-read --allow-write --allow-net --allow-env --allow-run --unstable-kv",
83
- "dependencies": ["codegen"]
84
- },
85
- "apidoc": {
86
- "command": "deno doc --html --name=Fedify --output=apidoc/ src/mod.ts",
87
- "dependencies": ["codegen"]
88
- },
89
- "publish": {
90
- "command": "deno publish",
91
- "dependencies": ["codegen"]
92
- },
93
- "pnpm:install": "pnpm install --silent",
94
- "pnpm:build": {
95
- "command": "pnpm exec tsdown",
96
- "dependencies": [
97
- "codegen",
98
- "pnpm:install",
99
- "pnpm:build-vocab"
100
- ]
101
- },
102
- "pnpm:build-vocab-runtime": { "command": "cd ../vocab-runtime && pnpm build" },
103
- "pnpm:build-vocab-tools": { "command": "cd ../vocab-tools && pnpm build" },
104
- "pnpm:build-vocab": { "dependencies": ["pnpm:build-vocab-runtime", "pnpm:build-vocab-tools"] },
105
- "test:node": {
106
- "command": "cd dist/ && node --test",
107
- "dependencies": ["pnpm:build"]
108
- },
109
- "test:bun": {
110
- "command": "cd dist/ && bun test --timeout 60000",
111
- "dependencies": ["pnpm:build-vocab", "pnpm:build"]
112
- },
113
- "test:cfworkers": {
114
- "command": "pnpm exec wrangler deploy --dry-run --outdir src/cfworkers && node --import=tsx src/cfworkers/client.ts",
115
- "dependencies": ["pnpm:build-vocab", "pnpm:build"]
116
- },
117
- "test-all": { "dependencies": [
118
- "check",
119
- "test",
120
- "test:node",
121
- "test:bun",
122
- "test:cfworkers"
123
- ] }
124
- };
125
- var deno_default = {
126
- name,
127
- version,
128
- license,
129
- exports: exports$1,
130
- imports,
131
- include,
132
- exclude,
133
- tasks
134
- };
135
-
136
- //#endregion
137
- //#region src/webfinger/lookup.ts
138
- const logger = (0, __logtape_logtape.getLogger)([
139
- "fedify",
140
- "webfinger",
141
- "lookup"
142
- ]);
143
- const DEFAULT_MAX_REDIRECTION = 5;
144
- /**
145
- * Looks up a WebFinger resource.
146
- * @param resource The resource URL to look up.
147
- * @param options Extra options for looking up the resource.
148
- * @returns The resource descriptor, or `null` if not found.
149
- * @since 0.2.0
150
- */
151
- async function lookupWebFinger(resource, options = {}) {
152
- const tracerProvider = options.tracerProvider ?? __opentelemetry_api.trace.getTracerProvider();
153
- const tracer = tracerProvider.getTracer(deno_default.name, deno_default.version);
154
- return await tracer.startActiveSpan("webfinger.lookup", {
155
- kind: __opentelemetry_api.SpanKind.CLIENT,
156
- attributes: {
157
- "webfinger.resource": resource.toString(),
158
- "webfinger.resource.scheme": typeof resource === "string" ? resource.replace(/:.*$/, "") : resource.protocol.replace(/:$/, "")
159
- }
160
- }, async (span) => {
161
- try {
162
- const result = await lookupWebFingerInternal(resource, options);
163
- span.setStatus({ code: result === null ? __opentelemetry_api.SpanStatusCode.ERROR : __opentelemetry_api.SpanStatusCode.OK });
164
- return result;
165
- } catch (error) {
166
- span.setStatus({
167
- code: __opentelemetry_api.SpanStatusCode.ERROR,
168
- message: String(error)
169
- });
170
- throw error;
171
- } finally {
172
- span.end();
173
- }
174
- });
175
- }
176
- async function lookupWebFingerInternal(resource, options = {}) {
177
- if (typeof resource === "string") resource = new URL(resource);
178
- let protocol = "https:";
179
- let server;
180
- if (resource.protocol === "acct:") {
181
- const atPos = resource.pathname.lastIndexOf("@");
182
- if (atPos < 0) return null;
183
- server = resource.pathname.substring(atPos + 1);
184
- if (server === "") return null;
185
- } else {
186
- protocol = resource.protocol;
187
- server = resource.host;
188
- }
189
- let url = new URL(`${protocol}//${server}/.well-known/webfinger`);
190
- url.searchParams.set("resource", resource.href);
191
- let redirected = 0;
192
- while (true) {
193
- logger.debug("Fetching WebFinger resource descriptor from {url}...", { url: url.href });
194
- let response;
195
- if (options.allowPrivateAddress !== true) try {
196
- await (0, __fedify_vocab_runtime.validatePublicUrl)(url.href);
197
- } catch (e) {
198
- if (e instanceof __fedify_vocab_runtime.UrlError) {
199
- logger.error("Invalid URL for WebFinger resource descriptor: {error}", { error: e });
200
- return null;
201
- }
202
- throw e;
203
- }
204
- try {
205
- response = await fetch(url, {
206
- headers: {
207
- Accept: "application/jrd+json",
208
- "User-Agent": typeof options.userAgent === "string" ? options.userAgent : (0, __fedify_vocab_runtime.getUserAgent)(options.userAgent)
209
- },
210
- redirect: "manual",
211
- signal: options.signal
212
- });
213
- } catch (error) {
214
- logger.debug("Failed to fetch WebFinger resource descriptor: {error}", {
215
- url: url.href,
216
- error
217
- });
218
- return null;
219
- }
220
- if (response.status >= 300 && response.status < 400 && response.headers.has("Location")) {
221
- redirected++;
222
- const maxRedirection = options.maxRedirection ?? DEFAULT_MAX_REDIRECTION;
223
- if (redirected >= maxRedirection) {
224
- logger.error("Too many redirections ({redirections}) while fetching WebFinger resource descriptor.", { redirections: redirected });
225
- return null;
226
- }
227
- const redirectedUrl = new URL(response.headers.get("Location"), response.url == null || response.url === "" ? url : response.url);
228
- if (redirectedUrl.protocol !== url.protocol) {
229
- logger.error("Redirected to a different protocol ({protocol} to {redirectedProtocol}) while fetching WebFinger resource descriptor.", {
230
- protocol: url.protocol,
231
- redirectedProtocol: redirectedUrl.protocol
232
- });
233
- return null;
234
- }
235
- url = redirectedUrl;
236
- continue;
237
- }
238
- if (!response.ok) {
239
- logger.debug("Failed to fetch WebFinger resource descriptor: {status} {statusText}.", {
240
- url: url.href,
241
- status: response.status,
242
- statusText: response.statusText
243
- });
244
- return null;
245
- }
246
- try {
247
- return await response.json();
248
- } catch (e) {
249
- if (e instanceof SyntaxError) {
250
- logger.debug("Failed to parse WebFinger resource descriptor as JSON: {error}", { error: e });
251
- return null;
252
- }
253
- throw e;
254
- }
255
- }
256
- }
257
-
258
- //#endregion
259
- Object.defineProperty(exports, 'deno_default', {
260
- enumerable: true,
261
- get: function () {
262
- return deno_default;
263
- }
264
- });
265
- Object.defineProperty(exports, 'lookupWebFinger', {
266
- enumerable: true,
267
- get: function () {
268
- return lookupWebFinger;
269
- }
270
- });
@@ -1,15 +0,0 @@
1
-
2
- const { Temporal } = require("@js-temporal/polyfill");
3
- const { URLPattern } = require("urlpattern-polyfill");
4
-
5
- require('./transformers-CoBS-oFG.cjs');
6
- require('./lookup-EHJhdA8l.cjs');
7
- require('./actor-BQuDqoKQ.cjs');
8
- const require_middleware = require('./middleware-B09KVcU4.cjs');
9
- require('./http-DarlEN23.cjs');
10
- require('./proof-CbB_yXKu.cjs');
11
- require('./types-CWgzGaqk.cjs');
12
- require('./kv-cache-BWWu8RyL.cjs');
13
- require('./vocab-DCYaqGPG.cjs');
14
-
15
- exports.FederationImpl = require_middleware.FederationImpl;
@@ -1,15 +0,0 @@
1
-
2
- import { Temporal } from "@js-temporal/polyfill";
3
- import { URLPattern } from "urlpattern-polyfill";
4
-
5
- import "./transformers-BFT6d7J5.js";
6
- import "./lookup-DdpqU9Gb.js";
7
- import "./actor-CtTW_fTc.js";
8
- import { ContextImpl, FederationImpl, InboxContextImpl, KvSpecDeterminer, createFederation } from "./middleware-B_rzGWsn.js";
9
- import "./http-DmUiHemJ.js";
10
- import "./proof-AhMjXzru.js";
11
- import "./types-BtUjyi5y.js";
12
- import "./kv-cache-B5TLf2fI.js";
13
- import "./vocab-CuAJ4Tbh.js";
14
-
15
- export { FederationImpl };
@@ -1,26 +0,0 @@
1
-
2
- import { Temporal } from "@js-temporal/polyfill";
3
- import { URLPattern } from "urlpattern-polyfill";
4
- globalThis.addEventListener = () => {};
5
-
6
- import "./lookup-Bhv7efZB.js";
7
- import { ContextImpl, FederationImpl, InboxContextImpl, KvSpecDeterminer, createFederation } from "./middleware-Aqt52eK0.js";
8
- import "./client-pY7-3icS.js";
9
- import "./types-C2XVl6gj.js";
10
- import "./actor-CmPnJ0G7.js";
11
- import "./key-BcT6cdMK.js";
12
- import "./http-BIYwcgTd.js";
13
- import "./ld-DR6mmQjt.js";
14
- import "./owner-DEgLiB7Z.js";
15
- import "./proof-p3cmdfis.js";
16
- import "./docloader-BkhI_RcC.js";
17
- import "./kv-cache-DN9pfMBe.js";
18
- import "./inbox-Dbt8hLxb.js";
19
- import "./builder-CLT_zIyw.js";
20
- import "./collection-BzWsN9pB.js";
21
- import "./keycache-B8aIeTgt.js";
22
- import "./negotiation-C4nFufNk.js";
23
- import "./retry-CfF8Gn4d.js";
24
- import "./send-CcKJ-npK.js";
25
-
26
- export { FederationImpl };