@fedify/fedify 2.0.0-dev.1593 → 2.0.0-dev.160
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.
- package/LICENSE +1 -1
- package/README.md +66 -30
- package/dist/{assert_rejects-DiIiJbZn.js → assert_rejects-Ce45JcFg.js} +1 -1
- package/dist/{assert_is_error-BPGph1Jx.js → assert_throws-BNXdRGWP.js} +31 -1
- package/dist/{builder-BgzJcrpt.js → builder-C9n2ExVv.js} +15 -8
- package/dist/chunk-DqRYRqnO.cjs +34 -0
- package/dist/client-94iWEfQa.d.cts +222 -0
- package/dist/{client-DF8anIB5.d.ts → client-BivSNrEg.d.ts} +3 -75
- package/dist/{client-CpxFv8ft.js → client-CgMTXmAD.js} +3 -22
- package/dist/compat/mod.cjs +10 -0
- package/dist/compat/mod.d.cts +7 -0
- package/dist/compat/mod.d.ts +6 -12
- package/dist/compat/mod.js +5 -5
- package/dist/compat/transformers.test.js +21 -20
- package/dist/compat-DmDDELst.cjs +4 -0
- package/dist/compat-nxUqe4Z-.js +4 -0
- package/dist/context-Bns6uTJq.js +109 -0
- package/dist/{context-9gCpIkiz.d.ts → context-CYZ2i00R.d.ts} +321 -129
- package/dist/context-D2MrtLch.d.cts +2447 -0
- package/dist/deno-B74l3pXN.js +117 -0
- package/dist/{testing-D4xRiVJV.js → dist-B5f6a8Tt.js} +90 -111
- package/dist/{authdocloader-DJtdyVPc.js → docloader-eucHnjj4.js} +17 -8
- package/dist/{esm-5nsZYnVB.js → esm-DGl7uK1r.js} +32 -17
- package/dist/federation/builder.test.js +12 -13
- package/dist/federation/collection.test.js +6 -9
- package/dist/federation/handler.test.js +115 -148
- package/dist/federation/idempotency.test.js +202 -0
- package/dist/federation/inbox.test.js +5 -6
- package/dist/federation/keycache.test.js +4 -5
- package/dist/federation/kv.test.js +61 -9
- package/dist/federation/middleware.test.js +311 -131
- package/dist/federation/mod.cjs +25 -0
- package/dist/federation/mod.d.cts +7 -0
- package/dist/federation/mod.d.ts +7 -13
- package/dist/federation/mod.js +11 -16
- package/dist/federation/mq.test.js +9 -10
- package/dist/federation/negotiation.test.js +25 -0
- package/dist/federation/retry.test.js +2 -4
- package/dist/federation/router.test.js +6 -8
- package/dist/federation/send.test.js +55 -15
- package/dist/{webfinger/handler.test.js → federation/webfinger.test.js} +27 -26
- package/dist/federation-B431K2gm.cjs +266 -0
- package/dist/{federation-CMX7WzeL.js → federation-BbZwNNWj.js} +31 -9
- package/dist/http-ClB3pLcL.d.cts +253 -0
- package/dist/{http-CQulyTuw.js → http-CrnYJYhM.js} +3 -2
- package/dist/{http-BqklewFY.js → http-DJ7KWfiN.js} +374 -14
- package/dist/{http-DqSNLFNY.d.ts → http-DLBDPal9.d.ts} +2 -2
- package/dist/http-DtRqZZgP.cjs +1222 -0
- package/dist/{inbox-B97Wrppe.js → inbox-6-2rtCJf.js} +25 -7
- package/dist/{key-D-s3dQbK.js → key-pYEsD-IB.js} +3 -2
- package/dist/{keycache-Br0-hsD5.js → keycache-DRxpZ5r9.js} +1 -1
- package/dist/{keys-DSk2aqlj.js → keys-ZbcByPg9.js} +2 -1
- package/dist/{kv-C7sopW2E.d.ts → kv-CtOmTRNc.d.ts} +30 -1
- package/dist/kv-D8q9fLkA.d.cts +110 -0
- package/dist/{kv-CRZrzyXm.js → kv-QzKcOQgP.js} +22 -0
- package/dist/kv-cache-BEeqyGER.js +107 -0
- package/dist/kv-cache-Cr66Hw1w.js +122 -0
- package/dist/kv-cache-jKJ4ZH0U.cjs +134 -0
- package/dist/{ld-CYUQO1l4.js → ld-Bmrvt1KE.js} +4 -2
- package/dist/middleware-BUywt3CE.cjs +4242 -0
- package/dist/middleware-Ba1Pxx8r.js +26 -0
- package/dist/{middleware-tfSiCl9w.js → middleware-ByNAm2-S.js} +272 -271
- package/dist/middleware-D6QDOyQU.cjs +12 -0
- package/dist/{middleware-CovCqg8w.js → middleware-D9L8QWDP.js} +230 -327
- package/dist/middleware-jJYYmbt6.js +12 -0
- package/dist/mod-BrS8tiad.d.cts +266 -0
- package/dist/mod-C81L6_lQ.d.cts +1 -0
- package/dist/mod-CJgbdSqb.d.ts +109 -0
- package/dist/mod-CNNTHyBC.d.cts +80 -0
- package/dist/mod-CS-MS7gZ.d.cts +62 -0
- package/dist/{mod-Bqxcp7eN.d.ts → mod-D_cmv2il.d.ts} +4 -4
- package/dist/mod-DcPRcifg.d.cts +107 -0
- package/dist/mod-DqFSzJA0.d.ts +64 -0
- package/dist/{mod-Drmz72EK.d.ts → mod-jOa7W503.d.ts} +3 -3
- package/dist/mod.cjs +55 -0
- package/dist/mod.d.cts +11 -0
- package/dist/mod.d.ts +11 -17
- package/dist/mod.js +15 -21
- package/dist/negotiation-5NPJL6zp.js +71 -0
- package/dist/nodeinfo/client.test.js +29 -111
- package/dist/nodeinfo/handler.test.js +26 -26
- package/dist/nodeinfo/mod.cjs +10 -0
- package/dist/nodeinfo/mod.d.cts +3 -0
- package/dist/nodeinfo/mod.d.ts +3 -5
- package/dist/nodeinfo/mod.js +6 -7
- package/dist/nodeinfo/types.test.js +7 -15
- package/dist/nodeinfo-BlLsRSiT.js +4 -0
- package/dist/nodeinfo-DuMYTpbZ.cjs +4 -0
- package/dist/otel/exporter.test.js +899 -0
- package/dist/otel/mod.cjs +262 -0
- package/dist/otel/mod.d.cts +230 -0
- package/dist/otel/mod.d.ts +232 -0
- package/dist/otel/mod.js +261 -0
- package/dist/{owner-CQPnQVtf.d.ts → owner-BgI8C-VY.d.ts} +2 -3
- package/dist/owner-C-zfmVAD.d.cts +66 -0
- package/dist/{owner-CBeUJR68.js → owner-vFiFLWHR.js} +45 -8
- package/dist/{proof-CHQnDg0z.js → proof-C-k7brtD.js} +3 -2
- package/dist/proof-CLwK-TXL.cjs +709 -0
- package/dist/{proof-D436ezTT.js → proof-Dp6V6HEi.js} +50 -14
- package/dist/router-D9eI0s4b.js +118 -0
- package/dist/{send-Bc0QdRlp.js → send-BVXXc0Cn.js} +9 -4
- package/dist/sig/http.test.js +11 -13
- package/dist/sig/key.test.js +9 -11
- package/dist/sig/ld.test.js +8 -10
- package/dist/sig/mod.cjs +26 -0
- package/dist/sig/mod.d.cts +4 -0
- package/dist/sig/mod.d.ts +3 -7
- package/dist/sig/mod.js +6 -10
- package/dist/sig/owner.test.js +33 -12
- package/dist/sig/proof.test.js +13 -14
- package/dist/sig-CwuONEzF.js +4 -0
- package/dist/sig-DeXX2xnj.cjs +4 -0
- package/dist/testing/mod.d.ts +180 -6946
- package/dist/testing/mod.js +4 -4
- package/dist/transformers-BjBg6Lag.cjs +116 -0
- package/dist/{transformers-Dna8Fg7k.js → transformers-N_ip_y4P.js} +5 -5
- package/dist/{types-BIgY6c-l.js → types-BEdCLHqP.js} +1 -3
- package/dist/types-Q-qkJXBV.cjs +315 -0
- package/dist/{types-RbpvCErq.js → types-hKTi53FO.js} +8 -169
- package/dist/{runtime/authdocloader.test.js → utils/docloader.test.js} +13 -15
- package/dist/utils/kv-cache.test.js +211 -0
- package/dist/utils/mod.cjs +10 -0
- package/dist/utils/mod.d.cts +4 -0
- package/dist/utils/mod.d.ts +6 -0
- package/dist/utils/mod.js +9 -0
- package/dist/utils-Db0ZmjcD.cjs +4 -0
- package/dist/utils-Wranxuoe.js +4 -0
- package/package.json +69 -55
- package/dist/actor-Bj1Vq2XG.js +0 -146
- package/dist/actor-C22bXuuC.d.ts +0 -130
- package/dist/actor-DNwcqwPT.js +0 -37312
- package/dist/assert_throws-BOO88avQ.js +0 -39
- package/dist/authdocloader-qkvj_KZY.js +0 -52
- package/dist/compat-Bb5myD13.js +0 -4
- package/dist/denokv-Bv33Xxea.js +0 -57
- package/dist/docloader-9_osWaaH.js +0 -4615
- package/dist/docloader-CxWcuWqQ.d.ts +0 -221
- package/dist/fixtures/activitypub.academy/users/brauca_darradiul.json +0 -83
- package/dist/fixtures/example.com/announce.json +0 -6
- package/dist/fixtures/example.com/collection.json +0 -19
- package/dist/fixtures/example.com/create.json +0 -6
- package/dist/fixtures/example.com/cross-origin-actor.json +0 -6
- package/dist/fixtures/example.com/hong-gildong.json +0 -11
- package/dist/fixtures/example.com/invite.json +0 -7
- package/dist/fixtures/example.com/key.json +0 -7
- package/dist/fixtures/example.com/key2.json +0 -6
- package/dist/fixtures/example.com/object.json +0 -6
- package/dist/fixtures/example.com/orderedcollectionpage.json +0 -24
- package/dist/fixtures/example.com/paged/a.json +0 -13
- package/dist/fixtures/example.com/paged/b.json +0 -16
- package/dist/fixtures/example.com/paged-collection.json +0 -6
- package/dist/fixtures/example.com/person.json +0 -22
- package/dist/fixtures/example.com/person2.json +0 -40
- package/dist/fixtures/example.com/test.json +0 -5
- package/dist/fixtures/example.com/users/handle.json +0 -16
- package/dist/fixtures/example.com/wrong-type.json +0 -3
- package/dist/fixtures/oeee.cafe/ap/users/3609fd4e-d51d-4db8-9f04-4189815864dd.json +0 -24
- package/dist/fixtures/remote.domain/users/bob.json +0 -20
- package/dist/fixtures/server.example/users/alice.json +0 -20
- package/dist/fixtures/w3id.org/identity/v1.json +0 -152
- package/dist/fixtures/w3id.org/security/data-integrity/v1.json +0 -74
- package/dist/fixtures/w3id.org/security/multikey/v1.json +0 -35
- package/dist/fixtures/w3id.org/security/v1.json +0 -50
- package/dist/fixtures/wizard.casa/users/hongminhee.json +0 -69
- package/dist/fixtures/www.w3.org/ns/activitystreams.json +0 -379
- package/dist/fixtures/www.w3.org/ns/did/v1.json +0 -58
- package/dist/key-3jGPh5To.js +0 -10
- package/dist/key-C3CEOTh7.js +0 -10
- package/dist/key-CNCeen0u.js +0 -260
- package/dist/lookup-BNFlahf3.js +0 -131
- package/dist/lookup-CnJK1NUl.js +0 -322
- package/dist/middleware-CJbNYdw9.js +0 -17
- package/dist/middleware-zDdNBo-m.js +0 -26
- package/dist/mod-Cxt4Kpf6.d.ts +0 -291
- package/dist/mod-DBzN0aCM.d.ts +0 -115
- package/dist/mod-TFoH2Ql8.d.ts +0 -104
- package/dist/mod-g0xFzAP9.d.ts +0 -2
- package/dist/mq-CRGm1e_F.d.ts +0 -143
- package/dist/nodeinfo/semver.test.js +0 -143
- package/dist/nodeinfo-CyEbLjHs.js +0 -4
- package/dist/runtime/docloader.test.js +0 -522
- package/dist/runtime/key.test.js +0 -103
- package/dist/runtime/langstr.test.js +0 -39
- package/dist/runtime/mod.d.ts +0 -8
- package/dist/runtime/mod.js +0 -13
- package/dist/runtime/multibase/multibase.test.d.ts +0 -3
- package/dist/runtime/multibase/multibase.test.js +0 -358
- package/dist/runtime/url.test.d.ts +0 -3
- package/dist/runtime/url.test.js +0 -45
- package/dist/runtime-BSkOVUWM.js +0 -4
- package/dist/semver-dArNLkR9.js +0 -149
- package/dist/sig-BXJO--F9.js +0 -4
- package/dist/src/vocab/accept.yaml +0 -15
- package/dist/src/vocab/activity.yaml +0 -98
- package/dist/src/vocab/add.yaml +0 -16
- package/dist/src/vocab/announce.yaml +0 -30
- package/dist/src/vocab/application.yaml +0 -324
- package/dist/src/vocab/arrive.yaml +0 -15
- package/dist/src/vocab/article.yaml +0 -46
- package/dist/src/vocab/audio.yaml +0 -11
- package/dist/src/vocab/block.yaml +0 -16
- package/dist/src/vocab/chatmessage.yaml +0 -50
- package/dist/src/vocab/collection.yaml +0 -154
- package/dist/src/vocab/collectionpage.yaml +0 -55
- package/dist/src/vocab/create.yaml +0 -28
- package/dist/src/vocab/dataintegrityproof.yaml +0 -56
- package/dist/src/vocab/delete.yaml +0 -27
- package/dist/src/vocab/didservice.yaml +0 -22
- package/dist/src/vocab/dislike.yaml +0 -14
- package/dist/src/vocab/document.yaml +0 -31
- package/dist/src/vocab/emoji.yaml +0 -12
- package/dist/src/vocab/emojireact.yaml +0 -17
- package/dist/src/vocab/endpoints.yaml +0 -85
- package/dist/src/vocab/event.yaml +0 -11
- package/dist/src/vocab/export.yaml +0 -9
- package/dist/src/vocab/flag.yaml +0 -15
- package/dist/src/vocab/follow.yaml +0 -19
- package/dist/src/vocab/group.yaml +0 -324
- package/dist/src/vocab/hashtag.yaml +0 -14
- package/dist/src/vocab/ignore.yaml +0 -14
- package/dist/src/vocab/image.yaml +0 -9
- package/dist/src/vocab/intransitiveactivity.yaml +0 -15
- package/dist/src/vocab/invite.yaml +0 -14
- package/dist/src/vocab/join.yaml +0 -14
- package/dist/src/vocab/key.yaml +0 -28
- package/dist/src/vocab/leave.yaml +0 -14
- package/dist/src/vocab/like.yaml +0 -16
- package/dist/src/vocab/link.yaml +0 -101
- package/dist/src/vocab/listen.yaml +0 -12
- package/dist/src/vocab/mention.yaml +0 -9
- package/dist/src/vocab/move.yaml +0 -15
- package/dist/src/vocab/multikey.yaml +0 -36
- package/dist/src/vocab/note.yaml +0 -48
- package/dist/src/vocab/object.yaml +0 -404
- package/dist/src/vocab/offer.yaml +0 -15
- package/dist/src/vocab/orderedcollection.yaml +0 -39
- package/dist/src/vocab/orderedcollectionpage.yaml +0 -50
- package/dist/src/vocab/organization.yaml +0 -324
- package/dist/src/vocab/page.yaml +0 -11
- package/dist/src/vocab/person.yaml +0 -324
- package/dist/src/vocab/place.yaml +0 -75
- package/dist/src/vocab/profile.yaml +0 -26
- package/dist/src/vocab/propertyvalue.yaml +0 -32
- package/dist/src/vocab/question.yaml +0 -103
- package/dist/src/vocab/read.yaml +0 -13
- package/dist/src/vocab/reject.yaml +0 -14
- package/dist/src/vocab/relationship.yaml +0 -52
- package/dist/src/vocab/remove.yaml +0 -14
- package/dist/src/vocab/service.yaml +0 -324
- package/dist/src/vocab/source.yaml +0 -26
- package/dist/src/vocab/tentativeaccept.yaml +0 -14
- package/dist/src/vocab/tentativereject.yaml +0 -14
- package/dist/src/vocab/tombstone.yaml +0 -24
- package/dist/src/vocab/travel.yaml +0 -16
- package/dist/src/vocab/undo.yaml +0 -26
- package/dist/src/vocab/update.yaml +0 -58
- package/dist/src/vocab/video.yaml +0 -11
- package/dist/src/vocab/view.yaml +0 -13
- package/dist/testing/docloader.test.js +0 -24
- package/dist/type-qs0mWLTm.js +0 -42007
- package/dist/vocab/actor.test.d.ts +0 -3
- package/dist/vocab/actor.test.js +0 -5965
- package/dist/vocab/lookup.test.d.ts +0 -3
- package/dist/vocab/lookup.test.js +0 -206
- package/dist/vocab/mod.d.ts +0 -8
- package/dist/vocab/mod.js +0 -10
- package/dist/vocab/schema.yaml +0 -247
- package/dist/vocab/type.test.d.ts +0 -3
- package/dist/vocab/type.test.js +0 -25
- package/dist/vocab/vocab.test.d.ts +0 -3
- package/dist/vocab/vocab.test.js +0 -3363
- package/dist/vocab-SOE1ifCr.d.ts +0 -14634
- package/dist/vocab-r-I1_ZmK.js +0 -246
- package/dist/webfinger/handler.test.d.ts +0 -3
- package/dist/webfinger/lookup.test.d.ts +0 -3
- package/dist/webfinger/lookup.test.js +0 -195
- package/dist/webfinger/mod.d.ts +0 -6
- package/dist/webfinger/mod.js +0 -9
- package/dist/webfinger-C3GIyXIg.js +0 -4
- package/dist/x/cfworkers.d.ts +0 -61
- package/dist/x/cfworkers.js +0 -98
- package/dist/x/cfworkers.test.d.ts +0 -3
- package/dist/x/cfworkers.test.js +0 -179
- package/dist/x/hono.d.ts +0 -56
- package/dist/x/hono.js +0 -60
- package/dist/x/sveltekit.d.ts +0 -48
- package/dist/x/sveltekit.js +0 -68
- /package/dist/{assert_not_equals-f3m3epl3.js → assert_not_equals-C80BG-_5.js} +0 -0
- /package/dist/{collection-CSzG2j1P.js → collection-CcnIw1qY.js} +0 -0
- /package/dist/{nodeinfo/semver.test.d.ts → federation/idempotency.test.d.ts} +0 -0
- /package/dist/{runtime/authdocloader.test.d.ts → federation/negotiation.test.d.ts} +0 -0
- /package/dist/{runtime/docloader.test.d.ts → federation/webfinger.test.d.ts} +0 -0
- /package/dist/{mod-1pDWKvUL.d.ts → mod-1E3W847c.d.ts} +0 -0
- /package/dist/{runtime/key.test.d.ts → otel/exporter.test.d.ts} +0 -0
- /package/dist/{std__assert-X-_kMxKM.js → std__assert-DWivtrGR.js} +0 -0
- /package/dist/{testing → utils}/docloader.test.d.ts +0 -0
- /package/dist/{runtime/langstr.test.d.ts → utils/kv-cache.test.d.ts} +0 -0
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
<!-- deno-fmt-ignore-file -->
|
|
2
2
|
|
|
3
|
-

|
|
4
|
-
|
|
5
|
-
=======================================
|
|
3
|
+
 Fedify: an ActivityPub server framework
|
|
4
|
+
=======================================================
|
|
6
5
|
|
|
7
6
|
[![JSR][JSR badge]][JSR]
|
|
8
7
|
[![npm][npm badge]][npm]
|
|
@@ -37,12 +36,12 @@ Currently, Fedify provides the following features out of the box:
|
|
|
37
36
|
If you want to know more about the project, please take a look at the following
|
|
38
37
|
resources:
|
|
39
38
|
|
|
40
|
-
- [Installation]
|
|
39
|
+
- [Installation]
|
|
41
40
|
- Tutorials:
|
|
42
|
-
[Learning the basics]
|
|
43
|
-
[Creating a microblog]
|
|
41
|
+
[Learning the basics] &
|
|
42
|
+
[Creating a microblog]
|
|
44
43
|
- [API reference][JSR]
|
|
45
|
-
- [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
|
-
[
|
|
54
|
+
[JSR]: https://jsr.io/@fedify/fedify
|
|
57
55
|
[npm badge]: https://img.shields.io/npm/v/@fedify/fedify?logo=npm
|
|
58
|
-
[
|
|
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
|
-
[
|
|
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
|
-
[
|
|
60
|
+
[Matrix]: https://matrix.to/#/#fedify:matrix.org
|
|
63
61
|
[Discord badge]: https://img.shields.io/discord/1295652627505217647?logo=discord&cacheSeconds=60
|
|
62
|
+
[Discord]: https://discord.gg/bhtwpzURwd
|
|
64
63
|
[@fedify@hollo.social badge]: https://fedi-badge.deno.dev/@fedify@hollo.social/followers.svg
|
|
65
64
|
[@fedify@hollo.social]: https://hollo.social/@fedify
|
|
66
65
|
[Fedify Demo]: https://dash.deno.com/playground/fedify-demo
|
|
@@ -73,8 +72,13 @@ join our [Matrix chat space][Matrix] or [Discord server][Discord] or
|
|
|
73
72
|
[FEP-8b32]: https://w3id.org/fep/8b32
|
|
74
73
|
[Linked Data Signatures]: https://web.archive.org/web/20170923124140/https://w3c-dvcg.github.io/ld-signatures/
|
|
75
74
|
[NodeInfo]: https://nodeinfo.diaspora.software/
|
|
75
|
+
[Installation]: https://fedify.dev/install
|
|
76
|
+
[Learning the basics]: https://fedify.dev/tutorial/basics
|
|
77
|
+
[Creating a microblog]: https://fedify.dev/tutorial/microblog
|
|
78
|
+
[Examples]: https://github.com/fedify-dev/fedify/tree/main/examples
|
|
76
79
|
[GitHub Discussions]: https://github.com/fedify-dev/fedify/discussions
|
|
77
80
|
[#Fedify]: https://mastodon.social/tags/fedify
|
|
81
|
+
|
|
78
82
|
[Mastodon]: https://joinmastodon.org/
|
|
79
83
|
[Lemmy]: https://join-lemmy.org/
|
|
80
84
|
[Pixelfed]: https://pixelfed.org/
|
|
@@ -90,24 +94,33 @@ which provides the core functionality of the framework. Other packages provide
|
|
|
90
94
|
integrations with various web frameworks, database drivers, and other features.
|
|
91
95
|
Here is the list of packages:
|
|
92
96
|
|
|
93
|
-
| Package
|
|
94
|
-
|
|
|
95
|
-
| [@fedify/fedify](/packages/fedify/)
|
|
96
|
-
| [@fedify/cli](/packages/cli/)
|
|
97
|
-
| [@fedify/amqp](/packages/amqp/)
|
|
98
|
-
| [@fedify/cfworkers](/packages/cfworkers/)
|
|
99
|
-
| [@fedify/denokv](/packages/denokv/)
|
|
100
|
-
| [@fedify/elysia](/packages/elysia/)
|
|
101
|
-
| [@fedify/express](/packages/express/)
|
|
102
|
-
| [@fedify/
|
|
103
|
-
| [@fedify/
|
|
104
|
-
| [@fedify/
|
|
105
|
-
| [@fedify/
|
|
106
|
-
| [@fedify/
|
|
107
|
-
| [@fedify/
|
|
108
|
-
| [@fedify/
|
|
109
|
-
| [@fedify/
|
|
110
|
-
| [@fedify/
|
|
97
|
+
| Package | JSR | npm | Description |
|
|
98
|
+
| ------------------------------------------------- | -------------------------------- | -------------------------------- | ---------------------------------------- |
|
|
99
|
+
| [@fedify/fedify](/packages/fedify/) | [JSR] | [npm] | The core framework of Fedify |
|
|
100
|
+
| [@fedify/cli](/packages/cli/) | [JSR][jsr:@fedify/cli] | [npm][npm:@fedify/cli] | CLI toolchain for testing and debugging |
|
|
101
|
+
| [@fedify/amqp](/packages/amqp/) | [JSR][jsr:@fedify/amqp] | [npm][npm:@fedify/amqp] | AMQP/RabbitMQ driver |
|
|
102
|
+
| [@fedify/cfworkers](/packages/cfworkers/) | [JSR][jsr:@fedify/cfworkers] | [npm][npm:@fedify/cfworkers] | Cloudflare Workers integration |
|
|
103
|
+
| [@fedify/denokv](/packages/denokv/) | [JSR][jsr:@fedify/denokv] | | Deno KV integration |
|
|
104
|
+
| [@fedify/elysia](/packages/elysia/) | | [npm][npm:@fedify/elysia] | Elysia integration |
|
|
105
|
+
| [@fedify/express](/packages/express/) | [JSR][jsr:@fedify/express] | [npm][npm:@fedify/express] | Express integration |
|
|
106
|
+
| [@fedify/fastify](/packages/fastify/) | [JSR][jsr:@fedify/fastify] | [npm][npm:@fedify/fastify] | Fastify integration |
|
|
107
|
+
| [@fedify/fresh](/packages/fresh/) | [JSR][jsr:@fedify/fresh] | | Fresh integration |
|
|
108
|
+
| [@fedify/h3](/packages/h3/) | [JSR][jsr:@fedify/h3] | [npm][npm:@fedify/h3] | H3 integration |
|
|
109
|
+
| [@fedify/hono](/packages/hono/) | [JSR][jsr:@fedify/hono] | [npm][npm:@fedify/hono] | Hono integration |
|
|
110
|
+
| [@fedify/koa](/packages/koa/) | [JSR][jsr:@fedify/koa] | [npm][npm:@fedify/koa] | Koa integration |
|
|
111
|
+
| [@fedify/lint](/packages/lint/) | [JSR][jsr:@fedify/lint] | [npm][npm:@fedify/lint] | Linting utilities |
|
|
112
|
+
| [@fedify/nestjs](/packages/nestjs/) | | [npm][npm:@fedify/nestjs] | NestJS integration |
|
|
113
|
+
| [@fedify/next](/packages/next/) | | [npm][npm:@fedify/next] | Next.js integration |
|
|
114
|
+
| [@fedify/postgres](/packages/postgres/) | [JSR][jsr:@fedify/postgres] | [npm][npm:@fedify/postgres] | PostgreSQL driver |
|
|
115
|
+
| [@fedify/redis](/packages/redis/) | [JSR][jsr:@fedify/redis] | [npm][npm:@fedify/redis] | Redis driver |
|
|
116
|
+
| [@fedify/relay](/packages/relay/) | [JSR][jsr:@fedify/relay] | [npm][npm:@fedify/relay] | ActivityPub relay support |
|
|
117
|
+
| [@fedify/sqlite](/packages/sqlite/) | [JSR][jsr:@fedify/sqlite] | [npm][npm:@fedify/sqlite] | SQLite driver |
|
|
118
|
+
| [@fedify/sveltekit](/packages/sveltekit/) | [JSR][jsr:@fedify/sveltekit] | [npm][npm:@fedify/sveltekit] | SvelteKit integration |
|
|
119
|
+
| [@fedify/testing](/packages/testing/) | [JSR][jsr:@fedify/testing] | [npm][npm:@fedify/testing] | Testing utilities |
|
|
120
|
+
| [@fedify/vocab](/packages/vocab/) | [JSR][jsr:@fedify/vocab] | [npm][npm:@fedify/vocab] | Activity Vocabulary library |
|
|
121
|
+
| [@fedify/vocab-runtime](/packages/vocab-runtime/) | [JSR][jsr:@fedify/vocab-runtime] | [npm][npm:@fedify/vocab-runtime] | Runtime library for code-generated vocab |
|
|
122
|
+
| [@fedify/vocab-tools](/packages/vocab-tools/) | [JSR][jsr:@fedify/vocab-tools] | [npm][npm:@fedify/vocab-tools] | Code generation tools for Activity Vocab |
|
|
123
|
+
| [@fedify/webfinger](/packages/webfinger/) | [JSR][jsr:@fedify/webfinger] | [npm][npm:@fedify/webfinger] | WebFinger client library for ActivityPub |
|
|
111
124
|
|
|
112
125
|
[jsr:@fedify/cli]: https://jsr.io/@fedify/cli
|
|
113
126
|
[npm:@fedify/cli]: https://www.npmjs.com/package/@fedify/cli
|
|
@@ -119,22 +132,39 @@ Here is the list of packages:
|
|
|
119
132
|
[npm:@fedify/elysia]: https://www.npmjs.com/package/@fedify/elysia
|
|
120
133
|
[jsr:@fedify/express]: https://jsr.io/@fedify/express
|
|
121
134
|
[npm:@fedify/express]: https://www.npmjs.com/package/@fedify/express
|
|
135
|
+
[jsr:@fedify/fastify]: https://jsr.io/@fedify/fastify
|
|
136
|
+
[npm:@fedify/fastify]: https://www.npmjs.com/package/@fedify/fastify
|
|
137
|
+
[jsr:@fedify/fresh]: https://jsr.io/@fedify/fresh
|
|
122
138
|
[jsr:@fedify/h3]: https://jsr.io/@fedify/h3
|
|
123
139
|
[npm:@fedify/h3]: https://www.npmjs.com/package/@fedify/h3
|
|
124
140
|
[jsr:@fedify/hono]: https://jsr.io/@fedify/hono
|
|
125
141
|
[npm:@fedify/hono]: https://www.npmjs.com/package/@fedify/hono
|
|
142
|
+
[jsr:@fedify/koa]: https://jsr.io/@fedify/koa
|
|
143
|
+
[npm:@fedify/koa]: https://www.npmjs.com/package/@fedify/koa
|
|
144
|
+
[jsr:@fedify/lint]: https://jsr.io/@fedify/lint
|
|
145
|
+
[npm:@fedify/lint]: https://www.npmjs.com/package/@fedify/lint
|
|
126
146
|
[npm:@fedify/nestjs]: https://www.npmjs.com/package/@fedify/nestjs
|
|
127
147
|
[npm:@fedify/next]: https://www.npmjs.com/package/@fedify/next
|
|
128
148
|
[jsr:@fedify/postgres]: https://jsr.io/@fedify/postgres
|
|
129
149
|
[npm:@fedify/postgres]: https://www.npmjs.com/package/@fedify/postgres
|
|
130
150
|
[jsr:@fedify/redis]: https://jsr.io/@fedify/redis
|
|
131
151
|
[npm:@fedify/redis]: https://www.npmjs.com/package/@fedify/redis
|
|
152
|
+
[jsr:@fedify/relay]: https://jsr.io/@fedify/relay
|
|
153
|
+
[npm:@fedify/relay]: https://www.npmjs.com/package/@fedify/relay
|
|
132
154
|
[jsr:@fedify/sqlite]: https://jsr.io/@fedify/sqlite
|
|
133
155
|
[npm:@fedify/sqlite]: https://www.npmjs.com/package/@fedify/sqlite
|
|
134
156
|
[jsr:@fedify/sveltekit]: https://jsr.io/@fedify/sveltekit
|
|
135
157
|
[npm:@fedify/sveltekit]: https://www.npmjs.com/package/@fedify/sveltekit
|
|
136
158
|
[jsr:@fedify/testing]: https://jsr.io/@fedify/testing
|
|
137
159
|
[npm:@fedify/testing]: https://www.npmjs.com/package/@fedify/testing
|
|
160
|
+
[jsr:@fedify/vocab]: https://jsr.io/@fedify/vocab
|
|
161
|
+
[npm:@fedify/vocab]: https://www.npmjs.com/package/@fedify/vocab
|
|
162
|
+
[jsr:@fedify/vocab-runtime]: https://jsr.io/@fedify/vocab-runtime
|
|
163
|
+
[npm:@fedify/vocab-runtime]: https://www.npmjs.com/package/@fedify/vocab-runtime
|
|
164
|
+
[jsr:@fedify/vocab-tools]: https://jsr.io/@fedify/vocab-tools
|
|
165
|
+
[npm:@fedify/vocab-tools]: https://www.npmjs.com/package/@fedify/vocab-tools
|
|
166
|
+
[jsr:@fedify/webfinger]: https://jsr.io/@fedify/webfinger
|
|
167
|
+
[npm:@fedify/webfinger]: https://www.npmjs.com/package/@fedify/webfinger
|
|
138
168
|
|
|
139
169
|
|
|
140
170
|
Sponsors
|
|
@@ -146,7 +176,10 @@ financial contributors:[^2]
|
|
|
146
176
|
|
|
147
177
|
[^2]: Those lists are automatically updated every hour.
|
|
148
178
|
|
|
179
|
+
<!-- hongdown-disable -->
|
|
180
|
+
|
|
149
181
|
<!-- cSpell: disable -->
|
|
182
|
+
|
|
150
183
|
<!-- DO NOT EDIT(h3): this section is automatically generated by the script -->
|
|
151
184
|
|
|
152
185
|
### Corporate sponsors
|
|
@@ -169,8 +202,11 @@ Robin Riley, yamanoku, Encyclia, taye, okin, Andy Piper, box464, Evan Prodromou,
|
|
|
169
202
|
Robin Riley, Markus P, Nils Bergmann, Rameez
|
|
170
203
|
|
|
171
204
|
<!-- /DO NOT EDIT -->
|
|
205
|
+
|
|
172
206
|
<!-- cSpell: enable -->
|
|
173
207
|
|
|
208
|
+
<!-- hongdown-enable -->
|
|
209
|
+
|
|
174
210
|
### Become a sponsor
|
|
175
211
|
|
|
176
212
|
We welcome financial contributions to help us maintain and improve this project.
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
6
|
import { AssertionError } from "./assert_equals-DSbWqCm3.js";
|
|
7
|
-
import { assertIsError } from "./
|
|
7
|
+
import { assertIsError } from "./assert_throws-BNXdRGWP.js";
|
|
8
8
|
|
|
9
9
|
//#region ../../node_modules/.pnpm/@jsr+std__assert@0.226.0/node_modules/@jsr/std__assert/assert_false.js
|
|
10
10
|
/**
|
|
@@ -45,4 +45,34 @@ import { AssertionError, stripAnsiCode } from "./assert_equals-DSbWqCm3.js";
|
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
//#endregion
|
|
48
|
-
|
|
48
|
+
//#region ../../node_modules/.pnpm/@jsr+std__assert@0.226.0/node_modules/@jsr/std__assert/assert_throws.js
|
|
49
|
+
function assertThrows(fn, errorClassOrMsg, msgIncludesOrMsg, msg) {
|
|
50
|
+
let ErrorClass = void 0;
|
|
51
|
+
let msgIncludes = void 0;
|
|
52
|
+
let err;
|
|
53
|
+
if (typeof errorClassOrMsg !== "string") if (errorClassOrMsg === void 0 || errorClassOrMsg?.prototype instanceof Error || errorClassOrMsg?.prototype === Error.prototype) {
|
|
54
|
+
ErrorClass = errorClassOrMsg;
|
|
55
|
+
msgIncludes = msgIncludesOrMsg;
|
|
56
|
+
} else msg = msgIncludesOrMsg;
|
|
57
|
+
else msg = errorClassOrMsg;
|
|
58
|
+
let doesThrow = false;
|
|
59
|
+
const msgSuffix = msg ? `: ${msg}` : ".";
|
|
60
|
+
try {
|
|
61
|
+
fn();
|
|
62
|
+
} catch (error) {
|
|
63
|
+
if (ErrorClass) {
|
|
64
|
+
if (error instanceof Error === false) throw new AssertionError(`A non-Error object was thrown${msgSuffix}`);
|
|
65
|
+
assertIsError(error, ErrorClass, msgIncludes, msg);
|
|
66
|
+
}
|
|
67
|
+
err = error;
|
|
68
|
+
doesThrow = true;
|
|
69
|
+
}
|
|
70
|
+
if (!doesThrow) {
|
|
71
|
+
msg = `Expected function to throw${msgSuffix}`;
|
|
72
|
+
throw new AssertionError(msg);
|
|
73
|
+
}
|
|
74
|
+
return err;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
//#endregion
|
|
78
|
+
export { assertIsError, assertThrows };
|
|
@@ -3,10 +3,11 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import { deno_default
|
|
7
|
-
import { Router, RouterError } from "./
|
|
8
|
-
import { InboxListenerSet } from "./inbox-
|
|
6
|
+
import { deno_default } from "./deno-B74l3pXN.js";
|
|
7
|
+
import { Router, RouterError } from "./router-D9eI0s4b.js";
|
|
8
|
+
import { InboxListenerSet } from "./inbox-6-2rtCJf.js";
|
|
9
9
|
import { getLogger } from "@logtape/logtape";
|
|
10
|
+
import { getTypeId } from "@fedify/vocab";
|
|
10
11
|
import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
|
|
11
12
|
|
|
12
13
|
//#region src/federation/builder.ts
|
|
@@ -28,6 +29,7 @@ var FederationBuilderImpl = class {
|
|
|
28
29
|
inboxListeners;
|
|
29
30
|
inboxErrorHandler;
|
|
30
31
|
sharedInboxKeyDispatcher;
|
|
32
|
+
idempotencyStrategy;
|
|
31
33
|
collectionTypeIds;
|
|
32
34
|
collectionCallbacks;
|
|
33
35
|
/**
|
|
@@ -42,7 +44,7 @@ var FederationBuilderImpl = class {
|
|
|
42
44
|
this.collectionTypeIds = {};
|
|
43
45
|
}
|
|
44
46
|
async build(options) {
|
|
45
|
-
const { FederationImpl } = await import("./middleware-
|
|
47
|
+
const { FederationImpl } = await import("./middleware-Ba1Pxx8r.js");
|
|
46
48
|
const f = new FederationImpl(options);
|
|
47
49
|
const trailingSlashInsensitiveValue = f.router.trailingSlashInsensitive;
|
|
48
50
|
f.router = this.router.clone();
|
|
@@ -64,6 +66,7 @@ var FederationBuilderImpl = class {
|
|
|
64
66
|
f.inboxListeners = this.inboxListeners?.clone();
|
|
65
67
|
f.inboxErrorHandler = this.inboxErrorHandler;
|
|
66
68
|
f.sharedInboxKeyDispatcher = this.sharedInboxKeyDispatcher;
|
|
69
|
+
f.idempotencyStrategy = this.idempotencyStrategy;
|
|
67
70
|
return f;
|
|
68
71
|
}
|
|
69
72
|
_getTracer() {
|
|
@@ -486,15 +489,19 @@ var FederationBuilderImpl = class {
|
|
|
486
489
|
setSharedKeyDispatcher: (dispatcher) => {
|
|
487
490
|
this.sharedInboxKeyDispatcher = dispatcher;
|
|
488
491
|
return setters;
|
|
492
|
+
},
|
|
493
|
+
withIdempotency: (strategy) => {
|
|
494
|
+
this.idempotencyStrategy = strategy;
|
|
495
|
+
return setters;
|
|
489
496
|
}
|
|
490
497
|
};
|
|
491
498
|
return setters;
|
|
492
499
|
}
|
|
493
|
-
setCollectionDispatcher(name,
|
|
494
|
-
return this.#setCustomCollectionDispatcher(name, "collection",
|
|
500
|
+
setCollectionDispatcher(name, itemType, path, dispatcher) {
|
|
501
|
+
return this.#setCustomCollectionDispatcher(name, "collection", itemType, path, dispatcher);
|
|
495
502
|
}
|
|
496
|
-
setOrderedCollectionDispatcher(name,
|
|
497
|
-
return this.#setCustomCollectionDispatcher(name, "orderedCollection",
|
|
503
|
+
setOrderedCollectionDispatcher(name, itemType, path, dispatcher) {
|
|
504
|
+
return this.#setCustomCollectionDispatcher(name, "orderedCollection", itemType, path, dispatcher);
|
|
498
505
|
}
|
|
499
506
|
#setCustomCollectionDispatcher(name, collectionType, itemType, path, dispatcher) {
|
|
500
507
|
const strName = String(name);
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
|
|
2
|
+
const { Temporal } = require("@js-temporal/polyfill");
|
|
3
|
+
const { URLPattern } = require("urlpattern-polyfill");
|
|
4
|
+
|
|
5
|
+
//#region rolldown:runtime
|
|
6
|
+
var __create = Object.create;
|
|
7
|
+
var __defProp = Object.defineProperty;
|
|
8
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
9
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
10
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
11
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
14
|
+
key = keys[i];
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
16
|
+
get: ((k) => from[k]).bind(null, key),
|
|
17
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
22
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
23
|
+
value: mod,
|
|
24
|
+
enumerable: true
|
|
25
|
+
}) : target, mod));
|
|
26
|
+
|
|
27
|
+
//#endregion
|
|
28
|
+
|
|
29
|
+
Object.defineProperty(exports, '__toESM', {
|
|
30
|
+
enumerable: true,
|
|
31
|
+
get: function () {
|
|
32
|
+
return __toESM;
|
|
33
|
+
}
|
|
34
|
+
});
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
import { GetUserAgentOptions } from "@fedify/vocab-runtime";
|
|
2
|
+
|
|
3
|
+
//#region src/nodeinfo/types.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* The type of the result of parsing JSON.
|
|
6
|
+
*/
|
|
7
|
+
type JsonValue = {
|
|
8
|
+
[key: string]: JsonValue | undefined;
|
|
9
|
+
} | JsonValue[] | string | number | boolean | null;
|
|
10
|
+
/**
|
|
11
|
+
* A NodeInfo object as defined in the NodeInfo 2.1 schema.
|
|
12
|
+
*/
|
|
13
|
+
interface NodeInfo {
|
|
14
|
+
/**
|
|
15
|
+
* Metadata about server software in use.
|
|
16
|
+
*/
|
|
17
|
+
software: Software;
|
|
18
|
+
/**
|
|
19
|
+
* The protocols supported on this server. At least one protocol must be
|
|
20
|
+
* supported.
|
|
21
|
+
*/
|
|
22
|
+
protocols: Protocol[];
|
|
23
|
+
/**
|
|
24
|
+
* The third party sites this server can connect to via their application API.
|
|
25
|
+
*/
|
|
26
|
+
services?: Services;
|
|
27
|
+
/**
|
|
28
|
+
* Whether this server allows open self-registration. Defaults to `false`.
|
|
29
|
+
*/
|
|
30
|
+
openRegistrations?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Usage statistics for this server.
|
|
33
|
+
*/
|
|
34
|
+
usage: Usage;
|
|
35
|
+
/**
|
|
36
|
+
* Free form key value pairs for software specific values.
|
|
37
|
+
* Clients should not rely on any specific key present.
|
|
38
|
+
*/
|
|
39
|
+
metadata?: Record<string, JsonValue>;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Metadata about server software in use.
|
|
43
|
+
*/
|
|
44
|
+
interface Software {
|
|
45
|
+
/**
|
|
46
|
+
* The canonical name of this server software. This must comply with
|
|
47
|
+
* pattern `/^[a-z0-9-]+$/`.
|
|
48
|
+
*/
|
|
49
|
+
name: string;
|
|
50
|
+
/**
|
|
51
|
+
* The version of this server software.
|
|
52
|
+
*/
|
|
53
|
+
version: string;
|
|
54
|
+
/**
|
|
55
|
+
* The URL of the source code repository of this server software.
|
|
56
|
+
*/
|
|
57
|
+
repository?: URL;
|
|
58
|
+
/**
|
|
59
|
+
* The URL of the homepage of this server software.
|
|
60
|
+
*/
|
|
61
|
+
homepage?: URL;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* The protocols supported on this server.
|
|
65
|
+
*/
|
|
66
|
+
type Protocol = "activitypub" | "buddycloud" | "dfrn" | "diaspora" | "libertree" | "ostatus" | "pumpio" | "tent" | "xmpp" | "zot";
|
|
67
|
+
/**
|
|
68
|
+
* The third party sites this server can connect to via their application API.
|
|
69
|
+
*/
|
|
70
|
+
interface Services {
|
|
71
|
+
/**
|
|
72
|
+
* The third party sites this server can retrieve messages from for combined
|
|
73
|
+
* display with regular traffic.
|
|
74
|
+
*/
|
|
75
|
+
inbound?: InboundService[];
|
|
76
|
+
/**
|
|
77
|
+
* The third party sites this server can publish messages to on the behalf
|
|
78
|
+
* of a user.
|
|
79
|
+
*/
|
|
80
|
+
outbound?: OutboundService[];
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* The third party sites this server can retrieve messages from for combined
|
|
84
|
+
* display with regular traffic.
|
|
85
|
+
*/
|
|
86
|
+
type InboundService = "atom1.0" | "gnusocial" | "imap" | "pnut" | "pop3" | "pumpio" | "rss2.0" | "twitter";
|
|
87
|
+
/**
|
|
88
|
+
* The third party sites this server can publish messages to on the behalf
|
|
89
|
+
* of a user.
|
|
90
|
+
*/
|
|
91
|
+
type OutboundService = "atom1.0" | "blogger" | "buddycloud" | "diaspora" | "dreamwidth" | "drupal" | "facebook" | "friendica" | "gnusocial" | "google" | "insanejournal" | "libertree" | "linkedin" | "livejournal" | "mediagoblin" | "myspace" | "pinterest" | "pnut" | "posterous" | "pumpio" | "redmatrix" | "rss2.0" | "smtp" | "tent" | "tumblr" | "twitter" | "wordpress" | "xmpp";
|
|
92
|
+
/**
|
|
93
|
+
* Usage statistics for this server.
|
|
94
|
+
*/
|
|
95
|
+
interface Usage {
|
|
96
|
+
/**
|
|
97
|
+
* Statistics about the users of this server.
|
|
98
|
+
*/
|
|
99
|
+
users: {
|
|
100
|
+
/**
|
|
101
|
+
* The total amount of on this server registered users. This number
|
|
102
|
+
* has to be an integer greater than or equal to zero.
|
|
103
|
+
*/
|
|
104
|
+
total?: number;
|
|
105
|
+
/**
|
|
106
|
+
* The amount of users that signed in at least once in the last 180 days.
|
|
107
|
+
* This number has to be an integer greater than or equal to zero.
|
|
108
|
+
*/
|
|
109
|
+
activeHalfyear?: number;
|
|
110
|
+
/**
|
|
111
|
+
* The amount of users that signed in at least once in the last 30 days.
|
|
112
|
+
* This number has to be an integer greater than or equal to zero.
|
|
113
|
+
*/
|
|
114
|
+
activeMonth?: number;
|
|
115
|
+
};
|
|
116
|
+
/**
|
|
117
|
+
* The amount of posts that were made by users that are registered on this
|
|
118
|
+
* server. This number has to be an integer greater than or equal to zero.
|
|
119
|
+
*/
|
|
120
|
+
localPosts: number;
|
|
121
|
+
/**
|
|
122
|
+
* The amount of comments that were made by users that are registered on this
|
|
123
|
+
* server. This number has to be an integer greater than or equal to zero.
|
|
124
|
+
*/
|
|
125
|
+
localComments: number;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Converts a {@link NodeInfo} object to a JSON value.
|
|
129
|
+
* @param nodeInfo The {@link NodeInfo} object to convert.
|
|
130
|
+
* @returns The JSON value that complies with the NodeInfo schema.
|
|
131
|
+
* @throws {TypeError} If the {@link NodeInfo} object is invalid.
|
|
132
|
+
*/
|
|
133
|
+
declare function nodeInfoToJson(nodeInfo: NodeInfo): JsonValue;
|
|
134
|
+
//#endregion
|
|
135
|
+
//#region src/nodeinfo/client.d.ts
|
|
136
|
+
/**
|
|
137
|
+
* Options for {@link getNodeInfo} function.
|
|
138
|
+
* @since 1.2.0
|
|
139
|
+
*/
|
|
140
|
+
interface GetNodeInfoOptions {
|
|
141
|
+
/**
|
|
142
|
+
* Whether to directly fetch the NodeInfo document from the given URL.
|
|
143
|
+
* Otherwise, the NodeInfo document will be fetched from the `.well-known`
|
|
144
|
+
* location of the given URL.
|
|
145
|
+
*
|
|
146
|
+
* Turned off by default.
|
|
147
|
+
*/
|
|
148
|
+
direct?: boolean;
|
|
149
|
+
/**
|
|
150
|
+
* How strictly to parse the NodeInfo document.
|
|
151
|
+
*
|
|
152
|
+
* - `"strict"`: Parse the NodeInfo document strictly. If the document is
|
|
153
|
+
* invalid, `undefined` is returned. This is the default.
|
|
154
|
+
* - `"best-effort"`: Try to parse the NodeInfo document even if it is
|
|
155
|
+
* invalid.
|
|
156
|
+
* - `"none"`: Do not parse the NodeInfo document. The function will return
|
|
157
|
+
* the raw JSON value.
|
|
158
|
+
*/
|
|
159
|
+
parse?: "strict" | "best-effort" | "none";
|
|
160
|
+
/**
|
|
161
|
+
* The options for making `User-Agent` header.
|
|
162
|
+
* If a string is given, it is used as the `User-Agent` header value.
|
|
163
|
+
* If an object is given, it is passed to {@link getUserAgent} to generate
|
|
164
|
+
* the `User-Agent` header value.
|
|
165
|
+
* @since 1.3.0
|
|
166
|
+
*/
|
|
167
|
+
userAgent?: GetUserAgentOptions | string;
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Fetches a NodeInfo document from the given URL.
|
|
171
|
+
* @param url The base URL of the server. If `options.direct` is turned off
|
|
172
|
+
* (default), the NodeInfo document will be fetched from
|
|
173
|
+
* the `.well-known` location of this URL (hence the only origin
|
|
174
|
+
* of the URL is used). If `options.direct` is turned on,
|
|
175
|
+
* the NodeInfo document will be fetched from the given URL.
|
|
176
|
+
* @param options Options for fetching the NodeInfo document.
|
|
177
|
+
* @returns The NodeInfo document if it could be fetched successfully.
|
|
178
|
+
* Otherwise, `undefined` is returned.
|
|
179
|
+
* @since 1.2.0
|
|
180
|
+
*/
|
|
181
|
+
declare function getNodeInfo(url: URL | string, options?: GetNodeInfoOptions & {
|
|
182
|
+
parse?: "strict" | "best-effort";
|
|
183
|
+
}): Promise<NodeInfo | undefined>;
|
|
184
|
+
/**
|
|
185
|
+
* Fetches a NodeInfo document from the given URL.
|
|
186
|
+
* @param url The base URL of the server. If `options.direct` is turned off
|
|
187
|
+
* (default), the NodeInfo document will be fetched from
|
|
188
|
+
* the `.well-known` location of this URL (hence the only origin
|
|
189
|
+
* of the URL is used). If `options.direct` is turned on,
|
|
190
|
+
* the NodeInfo document will be fetched from the given URL.
|
|
191
|
+
* @param options Options for fetching the NodeInfo document.
|
|
192
|
+
* @returns The NodeInfo document if it could be fetched successfully.
|
|
193
|
+
* Otherwise, `undefined` is returned.
|
|
194
|
+
* @since 1.2.0
|
|
195
|
+
*/
|
|
196
|
+
declare function getNodeInfo(url: URL | string, options: GetNodeInfoOptions & {
|
|
197
|
+
parse: "none";
|
|
198
|
+
}): Promise<JsonValue | undefined>;
|
|
199
|
+
/**
|
|
200
|
+
* Options for {@link parseNodeInfo} function.
|
|
201
|
+
* @since 1.2.0
|
|
202
|
+
*/
|
|
203
|
+
interface ParseNodeInfoOptions {
|
|
204
|
+
/**
|
|
205
|
+
* Whether to try to parse the NodeInfo document even if it is invalid.
|
|
206
|
+
* If turned on, the function will return a best-effort result.
|
|
207
|
+
*
|
|
208
|
+
* Turned off by default.
|
|
209
|
+
*/
|
|
210
|
+
tryBestEffort?: boolean;
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Parses a NodeInfo document.
|
|
214
|
+
* @param data A JSON value that complies with the NodeInfo schema.
|
|
215
|
+
* @param options Options for parsing the NodeInfo document.
|
|
216
|
+
* @returns The parsed NodeInfo document if it is valid. Otherwise, `null`
|
|
217
|
+
* is returned.
|
|
218
|
+
* @since 1.2.0
|
|
219
|
+
*/
|
|
220
|
+
declare function parseNodeInfo(data: unknown, options?: ParseNodeInfoOptions): NodeInfo | null;
|
|
221
|
+
//#endregion
|
|
222
|
+
export { GetNodeInfoOptions, InboundService, JsonValue, NodeInfo, OutboundService, ParseNodeInfoOptions, Protocol, Services, Software, Usage, getNodeInfo, nodeInfoToJson, parseNodeInfo };
|
|
@@ -1,78 +1,7 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
-
import { GetUserAgentOptions } from "
|
|
3
|
+
import { GetUserAgentOptions } from "@fedify/vocab-runtime";
|
|
4
4
|
|
|
5
|
-
//#region src/nodeinfo/semver.d.ts
|
|
6
|
-
/**
|
|
7
|
-
* A SemVer object parsed into its constituent parts.
|
|
8
|
-
* @since 1.2.0
|
|
9
|
-
*/
|
|
10
|
-
interface SemVer {
|
|
11
|
-
/** The major version */
|
|
12
|
-
major: number;
|
|
13
|
-
/** The minor version */
|
|
14
|
-
minor: number;
|
|
15
|
-
/** The patch version */
|
|
16
|
-
patch: number;
|
|
17
|
-
/**
|
|
18
|
-
* The prerelease version
|
|
19
|
-
*
|
|
20
|
-
* @default {[]}
|
|
21
|
-
*/
|
|
22
|
-
prerelease?: (string | number)[];
|
|
23
|
-
/**
|
|
24
|
-
* The build metadata
|
|
25
|
-
*
|
|
26
|
-
* @default {[]}
|
|
27
|
-
*/
|
|
28
|
-
build?: string[];
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Attempt to parse a string as a semantic version, returning a SemVer object.
|
|
32
|
-
*
|
|
33
|
-
* @example Usage
|
|
34
|
-
* ```ts
|
|
35
|
-
* import { parseSemVer } from "@fedify/fedify/nodeinfo";
|
|
36
|
-
* import { assertEquals } from "@std/assert";
|
|
37
|
-
*
|
|
38
|
-
* const version = parseSemVer("1.2.3");
|
|
39
|
-
* assertEquals(version, {
|
|
40
|
-
* major: 1,
|
|
41
|
-
* minor: 2,
|
|
42
|
-
* patch: 3,
|
|
43
|
-
* prerelease: [],
|
|
44
|
-
* build: [],
|
|
45
|
-
* });
|
|
46
|
-
* ```
|
|
47
|
-
*
|
|
48
|
-
* @throws {TypeError} If the input string is invalid.
|
|
49
|
-
* @param value The version string to parse
|
|
50
|
-
* @returns A valid SemVer
|
|
51
|
-
* @since 1.2.0
|
|
52
|
-
*/
|
|
53
|
-
declare function parseSemVer(value: string): SemVer;
|
|
54
|
-
/**
|
|
55
|
-
* Format a SemVer object into a string.
|
|
56
|
-
*
|
|
57
|
-
* @example Usage
|
|
58
|
-
* ```ts
|
|
59
|
-
* import { formatSemVer } from "@fedify/fedify/nodeinfo";
|
|
60
|
-
* import { assertEquals } from "@std/assert";
|
|
61
|
-
*
|
|
62
|
-
* const semver = {
|
|
63
|
-
* major: 1,
|
|
64
|
-
* minor: 2,
|
|
65
|
-
* patch: 3,
|
|
66
|
-
* };
|
|
67
|
-
* assertEquals(formatSemVer(semver), "1.2.3");
|
|
68
|
-
* ```
|
|
69
|
-
*
|
|
70
|
-
* @param version The SemVer to format
|
|
71
|
-
* @returns The string representation of a semantic version.
|
|
72
|
-
* @since 1.2.0
|
|
73
|
-
*/
|
|
74
|
-
declare function formatSemVer(version: SemVer): string;
|
|
75
|
-
//#endregion
|
|
76
5
|
//#region src/nodeinfo/types.d.ts
|
|
77
6
|
/**
|
|
78
7
|
* The type of the result of parsing JSON.
|
|
@@ -122,9 +51,8 @@ interface Software {
|
|
|
122
51
|
name: string;
|
|
123
52
|
/**
|
|
124
53
|
* The version of this server software.
|
|
125
|
-
* @see {@link parseSemVer}
|
|
126
54
|
*/
|
|
127
|
-
version:
|
|
55
|
+
version: string;
|
|
128
56
|
/**
|
|
129
57
|
* The URL of the source code repository of this server software.
|
|
130
58
|
*/
|
|
@@ -293,4 +221,4 @@ interface ParseNodeInfoOptions {
|
|
|
293
221
|
*/
|
|
294
222
|
declare function parseNodeInfo(data: unknown, options?: ParseNodeInfoOptions): NodeInfo | null;
|
|
295
223
|
//#endregion
|
|
296
|
-
export { GetNodeInfoOptions, InboundService, JsonValue, NodeInfo, OutboundService, ParseNodeInfoOptions, Protocol,
|
|
224
|
+
export { GetNodeInfoOptions, InboundService, JsonValue, NodeInfo, OutboundService, ParseNodeInfoOptions, Protocol, Services, Software, Usage, getNodeInfo, nodeInfoToJson, parseNodeInfo };
|