@fedify/fedify 2.0.0-dev.1561 → 2.0.0-dev.158
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 +40 -18
- 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-C8mpxJD3.js → builder-BnWso6VP.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-DI0GS_3p.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-CQV858ip.js +117 -0
- package/dist/{testing-DsuOHyiF.js → dist-B5f6a8Tt.js} +90 -111
- package/dist/{authdocloader-CN-tWO4K.js → docloader-Csc8gQux.js} +17 -8
- package/dist/{esm-CtgLSZwm.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-B_tXwHIe.js → http-BizGfAHd.js} +375 -15
- package/dist/{http-DTJgsmYR.js → http-CXG5ZFqn.js} +4 -3
- package/dist/http-ClB3pLcL.d.cts +253 -0
- package/dist/{http-DqSNLFNY.d.ts → http-DLBDPal9.d.ts} +2 -2
- package/dist/http-DbACqYyq.cjs +1222 -0
- package/dist/{inbox-Dx8EjUbq.js → inbox-B7ybw6fk.js} +25 -7
- package/dist/{key-olV6hEgm.js → key-C27c_yHR.js} +3 -2
- package/dist/{keycache-CExtp4Yl.js → keycache-DRxpZ5r9.js} +1 -1
- package/dist/{keys-O0-r0NpJ.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-B7dwGQFA.js +122 -0
- package/dist/kv-cache-BEeqyGER.js +107 -0
- package/dist/kv-cache-rPOPQdj9.cjs +134 -0
- package/dist/{ld-DR6b11xZ.js → ld-D_Jn1aGa.js} +6 -4
- package/dist/middleware-BVqYHBWm.cjs +12 -0
- package/dist/{middleware-GT7W03qw.js → middleware-BjS6_zkf.js} +272 -271
- package/dist/middleware-CAJR7KGo.cjs +4242 -0
- package/dist/{middleware-CUw3Ys9y.js → middleware-ClkhKNXU.js} +230 -327
- package/dist/middleware-DSz6sI16.js +26 -0
- package/dist/middleware-OcaFHSk8.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-BtFz-dZ-.js → owner-Dc8rUE-H.js} +45 -8
- package/dist/{proof-DsZjVJ0G.js → proof-BdNM3iSl.js} +4 -3
- package/dist/proof-Bx2JqJ-D.cjs +709 -0
- package/dist/{proof-DKDM7T5F.js → proof-CTYnbjx5.js} +53 -17
- package/dist/router-D9eI0s4b.js +118 -0
- package/dist/{send-s0_EjVhZ.js → send-DBRRqVMa.js} +9 -4
- package/dist/sig/http.test.js +12 -14
- 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-CGB4mJU6.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-C22bXuuC.d.ts +0 -130
- package/dist/actor-Qc3Ee6k1.js +0 -37311
- package/dist/actor-mhluotIb.js +0 -146
- package/dist/assert_throws-BOO88avQ.js +0 -39
- package/dist/authdocloader-Dp9WS-1G.js +0 -52
- package/dist/compat-Bb5myD13.js +0 -4
- package/dist/denokv-Bv33Xxea.js +0 -57
- package/dist/docloader-CxWcuWqQ.d.ts +0 -221
- package/dist/docloader-DIjo5mkd.js +0 -4615
- 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-CGjkGPkw.js +0 -260
- package/dist/key-CaFAQSic.js +0 -10
- package/dist/key-DcnCet42.js +0 -10
- package/dist/lookup-B8Ld9P9G.js +0 -131
- package/dist/lookup-IyAhz9I6.js +0 -322
- package/dist/middleware-Bx6Sgkth.js +0 -26
- package/dist/middleware-DdRB1d4s.js +0 -17
- 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-BMGxK0zE.js +0 -42006
- 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-CXuKLJjd.js +0 -246
- package/dist/vocab-SOE1ifCr.d.ts +0 -14634
- 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
|
@@ -90,24 +90,33 @@ which provides the core functionality of the framework. Other packages provide
|
|
|
90
90
|
integrations with various web frameworks, database drivers, and other features.
|
|
91
91
|
Here is the list of packages:
|
|
92
92
|
|
|
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/
|
|
93
|
+
| Package | JSR | npm | Description |
|
|
94
|
+
| --------------------------------------------------- | ---------------------------------- | ---------------------------------- | -------------------------------------------- |
|
|
95
|
+
| [@fedify/fedify](/packages/fedify/) | [JSR] | [npm] | The core framework of Fedify |
|
|
96
|
+
| [@fedify/cli](/packages/cli/) | [JSR][jsr:@fedify/cli] | [npm][npm:@fedify/cli] | CLI toolchain for testing and debugging |
|
|
97
|
+
| [@fedify/amqp](/packages/amqp/) | [JSR][jsr:@fedify/amqp] | [npm][npm:@fedify/amqp] | AMQP/RabbitMQ driver |
|
|
98
|
+
| [@fedify/cfworkers](/packages/cfworkers/) | [JSR][jsr:@fedify/cfworkers] | [npm][npm:@fedify/cfworkers] | Cloudflare Workers integration |
|
|
99
|
+
| [@fedify/denokv](/packages/denokv/) | [JSR][jsr:@fedify/denokv] | | Deno KV integration |
|
|
100
|
+
| [@fedify/elysia](/packages/elysia/) | | [npm][npm:@fedify/elysia] | Elysia integration |
|
|
101
|
+
| [@fedify/express](/packages/express/) | [JSR][jsr:@fedify/express] | [npm][npm:@fedify/express] | Express integration |
|
|
102
|
+
| [@fedify/fastify](/packages/fastify/) | [JSR][jsr:@fedify/fastify] | [npm][npm:@fedify/fastify] | Fastify integration |
|
|
103
|
+
| [@fedify/fresh](/packages/fresh/) | [JSR][jsr:@fedify/fresh] | | Fresh integration |
|
|
104
|
+
| [@fedify/h3](/packages/h3/) | [JSR][jsr:@fedify/h3] | [npm][npm:@fedify/h3] | H3 integration |
|
|
105
|
+
| [@fedify/hono](/packages/hono/) | [JSR][jsr:@fedify/hono] | [npm][npm:@fedify/hono] | Hono integration |
|
|
106
|
+
| [@fedify/koa](/packages/koa/) | [JSR][jsr:@fedify/koa] | [npm][npm:@fedify/koa] | Koa integration |
|
|
107
|
+
| [@fedify/lint](/packages/lint/) | [JSR][jsr:@fedify/lint] | [npm][npm:@fedify/lint] | Linting utilities |
|
|
108
|
+
| [@fedify/nestjs](/packages/nestjs/) | | [npm][npm:@fedify/nestjs] | NestJS integration |
|
|
109
|
+
| [@fedify/next](/packages/next/) | | [npm][npm:@fedify/next] | Next.js integration |
|
|
110
|
+
| [@fedify/postgres](/packages/postgres/) | [JSR][jsr:@fedify/postgres] | [npm][npm:@fedify/postgres] | PostgreSQL driver |
|
|
111
|
+
| [@fedify/redis](/packages/redis/) | [JSR][jsr:@fedify/redis] | [npm][npm:@fedify/redis] | Redis driver |
|
|
112
|
+
| [@fedify/relay](/packages/relay/) | [JSR][jsr:@fedify/relay] | [npm][npm:@fedify/relay] | ActivityPub relay support |
|
|
113
|
+
| [@fedify/sqlite](/packages/sqlite/) | [JSR][jsr:@fedify/sqlite] | [npm][npm:@fedify/sqlite] | SQLite driver |
|
|
114
|
+
| [@fedify/sveltekit](/packages/sveltekit/) | [JSR][jsr:@fedify/sveltekit] | [npm][npm:@fedify/sveltekit] | SvelteKit integration |
|
|
115
|
+
| [@fedify/testing](/packages/testing/) | [JSR][jsr:@fedify/testing] | [npm][npm:@fedify/testing] | Testing utilities |
|
|
116
|
+
| [@fedify/vocab](/packages/vocab/) | [JSR][jsr:@fedify/vocab] | [npm][npm:@fedify/vocab] | Activity Vocabulary library |
|
|
117
|
+
| [@fedify/vocab-runtime](/packages/vocab-runtime/) | [JSR][jsr:@fedify/vocab-runtime] | [npm][npm:@fedify/vocab-runtime] | Runtime library for code-generated vocab |
|
|
118
|
+
| [@fedify/vocab-tools](/packages/vocab-tools/) | [JSR][jsr:@fedify/vocab-tools] | [npm][npm:@fedify/vocab-tools] | Code generation tools for Activity Vocab |
|
|
119
|
+
| [@fedify/webfinger](/packages/webfinger/) | [JSR][jsr:@fedify/webfinger] | [npm][npm:@fedify/webfinger] | WebFinger client library for ActivityPub |
|
|
111
120
|
|
|
112
121
|
[jsr:@fedify/cli]: https://jsr.io/@fedify/cli
|
|
113
122
|
[npm:@fedify/cli]: https://www.npmjs.com/package/@fedify/cli
|
|
@@ -119,22 +128,35 @@ Here is the list of packages:
|
|
|
119
128
|
[npm:@fedify/elysia]: https://www.npmjs.com/package/@fedify/elysia
|
|
120
129
|
[jsr:@fedify/express]: https://jsr.io/@fedify/express
|
|
121
130
|
[npm:@fedify/express]: https://www.npmjs.com/package/@fedify/express
|
|
131
|
+
[jsr:@fedify/fastify]: https://jsr.io/@fedify/fastify
|
|
132
|
+
[npm:@fedify/fastify]: https://www.npmjs.com/package/@fedify/fastify
|
|
133
|
+
[jsr:@fedify/fresh]: https://jsr.io/@fedify/fresh
|
|
122
134
|
[jsr:@fedify/h3]: https://jsr.io/@fedify/h3
|
|
123
135
|
[npm:@fedify/h3]: https://www.npmjs.com/package/@fedify/h3
|
|
124
136
|
[jsr:@fedify/hono]: https://jsr.io/@fedify/hono
|
|
125
137
|
[npm:@fedify/hono]: https://www.npmjs.com/package/@fedify/hono
|
|
138
|
+
[jsr:@fedify/koa]: https://jsr.io/@fedify/koa
|
|
139
|
+
[npm:@fedify/koa]: https://www.npmjs.com/package/@fedify/koa
|
|
140
|
+
[jsr:@fedify/lint]: https://jsr.io/@fedify/lint
|
|
141
|
+
[npm:@fedify/lint]: https://www.npmjs.com/package/@fedify/lint
|
|
126
142
|
[npm:@fedify/nestjs]: https://www.npmjs.com/package/@fedify/nestjs
|
|
127
143
|
[npm:@fedify/next]: https://www.npmjs.com/package/@fedify/next
|
|
128
144
|
[jsr:@fedify/postgres]: https://jsr.io/@fedify/postgres
|
|
129
145
|
[npm:@fedify/postgres]: https://www.npmjs.com/package/@fedify/postgres
|
|
130
146
|
[jsr:@fedify/redis]: https://jsr.io/@fedify/redis
|
|
131
147
|
[npm:@fedify/redis]: https://www.npmjs.com/package/@fedify/redis
|
|
148
|
+
[jsr:@fedify/relay]: https://jsr.io/@fedify/relay
|
|
149
|
+
[npm:@fedify/relay]: https://www.npmjs.com/package/@fedify/relay
|
|
132
150
|
[jsr:@fedify/sqlite]: https://jsr.io/@fedify/sqlite
|
|
133
151
|
[npm:@fedify/sqlite]: https://www.npmjs.com/package/@fedify/sqlite
|
|
134
152
|
[jsr:@fedify/sveltekit]: https://jsr.io/@fedify/sveltekit
|
|
135
153
|
[npm:@fedify/sveltekit]: https://www.npmjs.com/package/@fedify/sveltekit
|
|
136
154
|
[jsr:@fedify/testing]: https://jsr.io/@fedify/testing
|
|
137
155
|
[npm:@fedify/testing]: https://www.npmjs.com/package/@fedify/testing
|
|
156
|
+
[jsr:@fedify/vocab-runtime]: https://jsr.io/@fedify/vocab-runtime
|
|
157
|
+
[npm:@fedify/vocab-runtime]: https://www.npmjs.com/package/@fedify/vocab-runtime
|
|
158
|
+
[jsr:@fedify/vocab-tools]: https://jsr.io/@fedify/vocab-tools
|
|
159
|
+
[npm:@fedify/vocab-tools]: https://www.npmjs.com/package/@fedify/vocab-tools
|
|
138
160
|
|
|
139
161
|
|
|
140
162
|
Sponsors
|
|
@@ -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-CQV858ip.js";
|
|
7
|
+
import { Router, RouterError } from "./router-D9eI0s4b.js";
|
|
8
|
+
import { InboxListenerSet } from "./inbox-B7ybw6fk.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-DSz6sI16.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 };
|
|
@@ -3,9 +3,8 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import { getUserAgent } from "./type-BMGxK0zE.js";
|
|
7
|
-
import { parseSemVer } from "./semver-dArNLkR9.js";
|
|
8
6
|
import { getLogger } from "@logtape/logtape";
|
|
7
|
+
import { getUserAgent } from "@fedify/vocab-runtime";
|
|
9
8
|
|
|
10
9
|
//#region src/nodeinfo/client.ts
|
|
11
10
|
const logger = getLogger([
|
|
@@ -133,28 +132,10 @@ function parseSoftware(data, options = {}) {
|
|
|
133
132
|
name = data.name.trim().toLowerCase();
|
|
134
133
|
} else return null;
|
|
135
134
|
let version;
|
|
136
|
-
if ("version" in data
|
|
137
|
-
version = parseSemVer(data.version);
|
|
138
|
-
} catch {
|
|
139
|
-
if (!options.tryBestEffort) return null;
|
|
140
|
-
const parts = data.version.split(".").map((p) => parseInt(p, 10));
|
|
141
|
-
version = {
|
|
142
|
-
major: !isNaN(parts[0]) ? parts[0] : 0,
|
|
143
|
-
minor: !isNaN(parts[1]) ? parts[1] : 0,
|
|
144
|
-
patch: !isNaN(parts[2]) ? parts[2] : 0,
|
|
145
|
-
build: [],
|
|
146
|
-
prerelease: []
|
|
147
|
-
};
|
|
148
|
-
}
|
|
135
|
+
if ("version" in data) version = String(data.version);
|
|
149
136
|
else {
|
|
150
137
|
if (!options.tryBestEffort) return null;
|
|
151
|
-
version =
|
|
152
|
-
major: 0,
|
|
153
|
-
minor: 0,
|
|
154
|
-
patch: 0,
|
|
155
|
-
build: [],
|
|
156
|
-
prerelease: []
|
|
157
|
-
};
|
|
138
|
+
version = "0.0.0";
|
|
158
139
|
}
|
|
159
140
|
let repository;
|
|
160
141
|
if ("repository" in data) {
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
|
|
2
|
+
const { Temporal } = require("@js-temporal/polyfill");
|
|
3
|
+
const { URLPattern } = require("urlpattern-polyfill");
|
|
4
|
+
|
|
5
|
+
const require_transformers = require('../transformers-BjBg6Lag.cjs');
|
|
6
|
+
require('../compat-DmDDELst.cjs');
|
|
7
|
+
|
|
8
|
+
exports.actorDehydrator = require_transformers.actorDehydrator;
|
|
9
|
+
exports.autoIdAssigner = require_transformers.autoIdAssigner;
|
|
10
|
+
exports.getDefaultActivityTransformers = require_transformers.getDefaultActivityTransformers;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import "../client-94iWEfQa.cjs";
|
|
2
|
+
import "../http-ClB3pLcL.cjs";
|
|
3
|
+
import "../owner-C-zfmVAD.cjs";
|
|
4
|
+
import { ActivityTransformer } from "../context-D2MrtLch.cjs";
|
|
5
|
+
import "../kv-D8q9fLkA.cjs";
|
|
6
|
+
import { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers } from "../mod-CNNTHyBC.cjs";
|
|
7
|
+
export { ActivityTransformer, actorDehydrator, autoIdAssigner, getDefaultActivityTransformers };
|
package/dist/compat/mod.d.ts
CHANGED
|
@@ -1,15 +1,9 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
-
import "../
|
|
4
|
-
import "../
|
|
5
|
-
import "../
|
|
6
|
-
import "../
|
|
7
|
-
import "../
|
|
8
|
-
import "../
|
|
9
|
-
import "../owner-CQPnQVtf.js";
|
|
10
|
-
import "../mod-Cxt4Kpf6.js";
|
|
11
|
-
import "../mod-DBzN0aCM.js";
|
|
12
|
-
import { ActivityTransformer } from "../context-9gCpIkiz.js";
|
|
13
|
-
import "../mq-CRGm1e_F.js";
|
|
14
|
-
import { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers } from "../mod-Bqxcp7eN.js";
|
|
3
|
+
import "../client-BivSNrEg.js";
|
|
4
|
+
import "../http-DLBDPal9.js";
|
|
5
|
+
import "../owner-BgI8C-VY.js";
|
|
6
|
+
import { ActivityTransformer } from "../context-CYZ2i00R.js";
|
|
7
|
+
import "../kv-CtOmTRNc.js";
|
|
8
|
+
import { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers } from "../mod-D_cmv2il.js";
|
|
15
9
|
export { ActivityTransformer, actorDehydrator, autoIdAssigner, getDefaultActivityTransformers };
|