@fedify/fedify 2.0.0-pr.412.1559 → 2.0.0-pr.412.1794
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/README.md +3 -0
- package/dist/{actor-Cc6B76eG.js → actor-BXHc5r-q.js} +1 -1
- package/dist/actor-Ba9Z1eNJ.cjs +42079 -0
- package/dist/{actor-C22bXuuC.d.ts → actor-DqFajh9s.d.ts} +2 -2
- package/dist/{actor-CTAuCsWy.js → actor-DzhunPC_.js} +7058 -2722
- package/dist/actor-f2NtjyCg.d.cts +128 -0
- 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-BOEBObR8.js → builder-u7usRsT3.js} +13 -8
- package/dist/chunk-DqRYRqnO.cjs +34 -0
- package/dist/client-94iWEfQa.d.cts +222 -0
- package/dist/{client-DF8anIB5.d.ts → client-BsGzbnV-.d.ts} +3 -75
- package/dist/{client-De-z2UnN.js → client-pY7-3icS.js} +3 -22
- package/dist/compat/mod.cjs +10 -0
- package/dist/compat/mod.d.cts +12 -0
- package/dist/compat/mod.d.ts +11 -12
- package/dist/compat/mod.js +5 -5
- package/dist/compat/transformers.test.js +20 -20
- package/dist/compat-DmDDELst.cjs +4 -0
- package/dist/compat-nxUqe4Z-.js +4 -0
- package/dist/{context-9gCpIkiz.d.ts → context-DG0huGW-.d.ts} +184 -127
- package/dist/context-DJ8aSy2Q.d.cts +2312 -0
- package/dist/{authdocloader-CLgDGafZ.js → docloader-CrbAy9Oc.js} +17 -8
- package/dist/{esm-CHdxdkuH.js → esm-C-Qa1zEM.js} +11 -11
- package/dist/federation/builder.test.js +9 -12
- package/dist/federation/collection.test.js +7 -9
- package/dist/federation/handler.test.js +27 -148
- package/dist/federation/idempotency.test.js +201 -0
- package/dist/federation/inbox.test.js +4 -6
- package/dist/federation/keycache.test.js +3 -4
- package/dist/federation/kv.test.js +7 -8
- package/dist/federation/middleware.test.js +242 -64
- package/dist/federation/mod.cjs +27 -0
- package/dist/federation/mod.d.cts +12 -0
- package/dist/federation/mod.d.ts +12 -13
- package/dist/federation/mod.js +13 -15
- package/dist/federation/mq.test.js +8 -10
- package/dist/federation/negotiation.test.js +26 -0
- package/dist/federation/retry.test.js +4 -5
- package/dist/federation/router.test.js +6 -8
- package/dist/federation/send.test.js +13 -15
- package/dist/federation-CRpdnOMS.cjs +244 -0
- package/dist/{federation-CMX7WzeL.js → federation-jcR8-ZxP.js} +3 -3
- package/dist/fixtures/media.example.com/avatars/test-avatar.jpg.json +6 -0
- package/dist/{http-DqSNLFNY.d.ts → http-BbO0ejuk.d.ts} +2 -2
- package/dist/{http-l0TEupZK.js → http-CUVx-vzb.js} +260 -10
- package/dist/{http-CcdM1brU.js → http-D2kIm9la.js} +3 -3
- package/dist/http-Dofes42e.cjs +1106 -0
- package/dist/http-M8k5mKc0.d.cts +253 -0
- package/dist/{inbox-B6DZbGNf.js → inbox-HjG5peXY.js} +24 -7
- package/dist/{key-CzLv1phF.js → key-CxdLUFS6.js} +3 -2
- package/dist/{keycache-B8HdZJSt.js → keycache-bU7COwsh.js} +1 -1
- package/dist/{keys-zZwiKkfx.js → keys-DMHs8XNn.js} +2 -1
- package/dist/kv-Bxr0Q87_.d.cts +81 -0
- package/dist/kv-cache-CGXcDejL.js +122 -0
- package/dist/kv-cache-DN9pfMBe.js +94 -0
- package/dist/kv-cache-Dkvbn6rg.cjs +134 -0
- package/dist/{ld-CBcQdZ6N.js → ld-CIhvSCCr.js} +5 -4
- package/dist/lookup-CHkCVZTU.js +260 -0
- package/dist/lookup-CfFkONZD.cjs +272 -0
- package/dist/{type-SK-d7Tbw.js → lookup-DQRtjvb1.js} +7266 -7087
- package/dist/middleware-Bot7EEwV.js +26 -0
- package/dist/middleware-CFJgmUMW.cjs +15 -0
- package/dist/{middleware-BRgu1IH8.js → middleware-CJlj5Olw.js} +86 -181
- package/dist/middleware-CjHl2NHA.js +15 -0
- package/dist/middleware-D74TgW2E.cjs +4225 -0
- package/dist/{middleware-CxEkcFW0.js → middleware-DMk2Mdn9.js} +117 -127
- package/dist/mod-0noXw66R.d.cts +107 -0
- package/dist/mod-B-hUPT2N.d.cts +1 -0
- package/dist/{mod-Drmz72EK.d.ts → mod-B2iOw50L.d.ts} +3 -3
- package/dist/mod-B9M-8jm2.d.ts +109 -0
- package/dist/{mod-Cxt4Kpf6.d.ts → mod-BlVovdcy.d.ts} +20 -2
- package/dist/{mod-Bqxcp7eN.d.ts → mod-BoHnwOCs.d.ts} +2 -2
- package/dist/mod-BxRCHTz-.d.cts +307 -0
- package/dist/mod-C2tOeRkN.d.cts +1 -0
- package/dist/mod-C58MZ7Wx.d.cts +113 -0
- package/dist/mod-DJcZDvjA.d.cts +80 -0
- package/dist/mod-DgdBYYa0.d.cts +266 -0
- package/dist/{mod-DBzN0aCM.d.ts → mod-Ds0mpFZU.d.ts} +1 -1
- package/dist/mod.cjs +137 -0
- package/dist/mod.d.cts +16 -0
- package/dist/mod.d.ts +16 -17
- package/dist/mod.js +19 -21
- package/dist/mq-DcJPkXD5.d.cts +140 -0
- package/dist/negotiation-C4nFufNk.js +71 -0
- package/dist/nodeinfo/client.test.js +30 -111
- package/dist/nodeinfo/handler.test.js +25 -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 +8 -15
- package/dist/nodeinfo-BnthBobC.js +4 -0
- package/dist/nodeinfo-CdN0rEnZ.cjs +4 -0
- package/dist/owner-B4HbyP8s.d.cts +67 -0
- package/dist/{owner-VEIjmR8r.js → owner-Dvh7mBvr.js} +3 -2
- package/dist/{owner-CQPnQVtf.d.ts → owner-kQRGVXG1.d.ts} +3 -3
- package/dist/proof-D0uThUvD.cjs +674 -0
- package/dist/{proof-DoSQAGkE.js → proof-Dgy35fzc.js} +3 -3
- package/dist/{proof-tgUlT8hw.js → proof-fqzaMJ4g.js} +11 -10
- package/dist/{send-BzS7w-QF.js → send-Drp20VO9.js} +2 -2
- package/dist/sig/http.test.js +13 -14
- package/dist/sig/key.test.js +9 -11
- package/dist/sig/ld.test.js +8 -10
- package/dist/sig/mod.cjs +28 -0
- package/dist/sig/mod.d.cts +6 -0
- package/dist/sig/mod.d.ts +5 -7
- package/dist/sig/mod.js +8 -10
- package/dist/sig/owner.test.js +10 -12
- package/dist/sig/proof.test.js +13 -14
- package/dist/sig-C34-oHBl.js +4 -0
- package/dist/sig-YYj5tCnr.cjs +4 -0
- package/dist/testing/docloader.test.js +6 -8
- package/dist/testing/mod.d.ts +387 -224
- package/dist/testing/mod.js +2 -3
- package/dist/{testing-Z2omCvKy.js → testing-g4UC4liW.js} +1 -2
- package/dist/{transformers-Dna8Fg7k.js → transformers-BFT6d7J5.js} +3 -3
- package/dist/transformers-CoBS-oFG.cjs +116 -0
- package/dist/{types-DgPvoUWN.js → types-BtUjyi5y.js} +8 -169
- package/dist/{types-BIgY6c-l.js → types-C2XVl6gj.js} +1 -3
- package/dist/types-CWgzGaqk.cjs +315 -0
- package/dist/{runtime/authdocloader.test.js → utils/docloader.test.js} +14 -15
- package/dist/utils/kv-cache.test.js +209 -0
- package/dist/utils/mod.cjs +12 -0
- package/dist/utils/mod.d.cts +5 -0
- package/dist/utils/mod.d.ts +7 -0
- package/dist/utils/mod.js +11 -0
- package/dist/utils-D-Va7aXC.js +4 -0
- package/dist/utils-DyRU1gdZ.cjs +4 -0
- package/dist/vocab/actor.test.js +8 -10
- package/dist/vocab/lookup.test.js +257 -9
- package/dist/vocab/mod.cjs +86 -0
- package/dist/vocab/mod.d.cts +4 -0
- package/dist/vocab/mod.d.ts +3 -5
- package/dist/vocab/mod.js +6 -7
- package/dist/vocab/type.test.js +2 -3
- package/dist/vocab/vocab.test.js +438 -15
- package/dist/{vocab-SOE1ifCr.d.ts → vocab-BCWe1Ih5.d.ts} +292 -21
- package/dist/{vocab-CvD6Vbml.js → vocab-BnR3nIU9.js} +26 -17
- package/dist/vocab-CeDBzu-f.d.cts +14903 -0
- package/dist/{lookup-Bn_HEC_d.js → vocab-DFaWWYDn.cjs} +108 -139
- package/dist/webfinger/handler.test.js +24 -25
- package/dist/webfinger/lookup.test.js +7 -9
- package/dist/webfinger/mod.cjs +8 -0
- package/dist/webfinger/mod.d.cts +2 -0
- package/dist/webfinger/mod.d.ts +1 -3
- package/dist/webfinger/mod.js +5 -6
- package/dist/webfinger-C72Y8lrh.js +4 -0
- package/dist/webfinger-vAtLmxOF.cjs +4 -0
- package/dist/x/cfworkers.cjs +100 -0
- package/dist/x/cfworkers.d.cts +59 -0
- package/dist/x/cfworkers.d.ts +2 -2
- package/dist/x/cfworkers.js +3 -3
- package/dist/x/cfworkers.test.js +6 -8
- package/dist/x/hono.cjs +61 -0
- package/dist/x/hono.d.cts +53 -0
- package/dist/x/hono.d.ts +10 -11
- package/dist/x/hono.js +3 -3
- package/dist/x/sveltekit.cjs +69 -0
- package/dist/x/sveltekit.d.cts +45 -0
- package/dist/x/sveltekit.d.ts +10 -11
- package/dist/x/sveltekit.js +3 -3
- package/package.json +79 -23
- package/dist/assert_throws-BOO88avQ.js +0 -39
- package/dist/authdocloader-BFVqUbyo.js +0 -52
- package/dist/compat-Bb5myD13.js +0 -4
- package/dist/docloader-CxWcuWqQ.d.ts +0 -221
- package/dist/docloader-DEhniCVa.js +0 -4615
- package/dist/key-CUZQgVlf.js +0 -10
- package/dist/key-Deb0_wWL.js +0 -10
- package/dist/key-DxA6xRtZ.js +0 -260
- package/dist/lookup-dtdr2ftf.js +0 -131
- package/dist/middleware-BE_geSiJ.js +0 -17
- package/dist/middleware-BnU6hzVp.js +0 -26
- package/dist/mod-TFoH2Ql8.d.ts +0 -104
- 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.d.ts +0 -3
- 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/webfinger-C3GIyXIg.js +0 -4
- /package/dist/{assert_not_equals-f3m3epl3.js → assert_not_equals-C80BG-_5.js} +0 -0
- /package/dist/{collection-CSzG2j1P.js → collection-BzWsN9pB.js} +0 -0
- /package/dist/{denokv-Bv33Xxea.js → denokv-CCssOzMJ.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/{kv-C7sopW2E.d.ts → kv-BKNZ-Tb-.d.ts} +0 -0
- /package/dist/{mod-1pDWKvUL.d.ts → mod-CVgZgliM.d.ts} +0 -0
- /package/dist/{mod-g0xFzAP9.d.ts → mod-xIj-IT58.d.ts} +0 -0
- /package/dist/{mq-CRGm1e_F.d.ts → mq-CUKlBw08.d.ts} +0 -0
- /package/dist/{retry-D4GJ670a.js → retry-CfF8Gn4d.js} +0 -0
- /package/dist/{std__assert-X-_kMxKM.js → std__assert-DWivtrGR.js} +0 -0
- /package/dist/{runtime → utils}/docloader.test.d.ts +0 -0
- /package/dist/{runtime/key.test.d.ts → utils/kv-cache.test.d.ts} +0 -0
package/dist/mod.d.ts
CHANGED
@@ -1,19 +1,18 @@
|
|
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 {
|
10
|
-
import {
|
11
|
-
import {
|
12
|
-
import {
|
13
|
-
import {
|
14
|
-
import
|
15
|
-
import "./mod-
|
16
|
-
import "./mod-
|
17
|
-
import {
|
18
|
-
|
19
|
-
export { Accept, Activity, ActivityTransformer, Actor, ActorAliasMapper, ActorCallbackSetters, ActorDispatcher, ActorHandleMapper, ActorKeyPair, ActorKeyPairsDispatcher, ActorTypeName, Add, Announce, Application, Arrive, Article, Audio, AuthenticatedDocumentLoaderFactory, AuthorizePredicate, Block, ChatMessage, Collection, CollectionCallbackSetters, CollectionCounter, CollectionCursor, CollectionDispatcher, CollectionPage, ConstructorWithTypeId, Context, Create, CreateExponentialBackoffPolicyOptions, CreateFederationOptions, CreateProofOptions, CreateSignatureOptions, CryptographicKey, CustomCollectionCallbackSetters, CustomCollectionCounter, CustomCollectionCursor, CustomCollectionDispatcher, DataIntegrityProof, Delete, DidService, Dislike, Document, DocumentLoader, DocumentLoaderFactory, DocumentLoaderFactoryOptions, DoesActorOwnKeyOptions, Emoji, EmojiReact, Endpoints, Event, Export, Federatable, Federation, FederationBuilder, FederationFetchOptions, FederationKvPrefixes, FederationOptions, FederationOrigin, FederationQueueOptions, FederationStartQueueOptions, FediverseHandle, FetchError, FetchKeyOptions, FetchKeyResult, Flag, Follow, ForwardActivityOptions, GetActorHandleOptions, GetAuthenticatedDocumentLoaderOptions, GetDocumentLoaderOptions, GetKeyOwnerOptions, GetNodeInfoOptions, GetSignedKeyOptions, GetUserAgentOptions, Group, Hashtag, HttpMessageSignaturesSpec, HttpMessageSignaturesSpecDeterminer, Ignore, Image, InProcessMessageQueue, InProcessMessageQueueOptions, InboundService, InboxContext, InboxErrorHandler, InboxListener, InboxListenerSetters, IntransitiveActivity, Invite, Join, JsonValue, KeyCache, KvCacheParameters, KvKey, KvStore, KvStoreSetOptions, LanguageString, Leave, Like, Link, Listen, LookupObjectOptions, MemoryKvStore, Mention, Message, MessageQueue, MessageQueueEnqueueOptions, MessageQueueListenOptions, Move, Multikey, NodeInfo, NodeInfoDispatcher, NormalizeActorHandleOptions, Note, Object$1 as Object, ObjectAuthorizePredicate, ObjectCallbackSetters, ObjectDispatcher, Offer, OrderedCollection, OrderedCollectionPage, Organization, OutboundService, OutboxErrorHandler, PUBLIC_COLLECTION, Page, PageItems, ParallelMessageQueue, ParamsKeyPath, ParseNodeInfoOptions, ParseUriResult, Person, Place, Profile, PropertyValue, Protocol, Question, Read, Recipient, Reject, Relationship, RemoteDocument, Remove, RequestContext, ResourceDescriptor, RespondWithObjectOptions, RetryContext, RetryPolicy, RouteActivityOptions, Router, RouterError, RouterOptions, RouterRouteResult, SemVer, SendActivityOptions, SendActivityOptionsForCollection, SenderKeyPair, Service, Services, SharedInboxKeyDispatcher, SignJsonLdOptions, SignObjectOptions, SignRequestOptions, Software, Source, TentativeAccept, TentativeReject, Tombstone, Travel, TraverseCollectionOptions, Undo, Update, Usage, VerifyJsonLdOptions, VerifyObjectOptions, VerifyProofOptions, VerifyRequestOptions, VerifySignatureOptions, Video, View, WebFingerLinksDispatcher, actorDehydrator, attachSignature, autoIdAssigner, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, createProof, createSignature, detachSignature, digest, doesActorOwnKey, exportJwk, exportMultibaseKey, exportSpki, fetchDocumentLoader, fetchKey, formatSemVer, generateCryptoKeyPair, getActorClassByTypeName, getActorHandle, getActorTypeName, getAuthenticatedDocumentLoader, getDefaultActivityTransformers, getDocumentLoader, getKeyOwner, getNodeInfo, getTypeId, getUserAgent, importJwk, importMultibaseKey, importPem, importPkcs1, importSpki, isActor, isFediverseHandle, kvCache, lookupObject, lookupWebFinger, nodeInfoToJson, normalizeActorHandle, parseFediverseHandle, parseNodeInfo, parseSemVer, respondWithObject, respondWithObjectIfAcceptable, signJsonLd, signObject, signRequest, toAcctUrl, traverseCollection, verifyJsonLd, verifyObject, verifyProof, verifyRequest, verifySignature };
|
3
|
+
import { GetNodeInfoOptions, InboundService, JsonValue, NodeInfo, OutboundService, ParseNodeInfoOptions, Protocol, Services, Software, Usage, getNodeInfo, nodeInfoToJson, parseNodeInfo } from "./client-BsGzbnV-.js";
|
4
|
+
import { Accept, Activity, Add, Announce, Application, Arrive, Article, Audio, Block, ChatMessage, Collection, CollectionPage, Create, CryptographicKey, DataIntegrityProof, Delete, DidService, Dislike, Document, Emoji, EmojiReact, Endpoints, Event, Export, Flag, Follow, Group, Hashtag, Ignore, Image, IntransitiveActivity, Invite, Join, Leave, Like, Link, Listen, Mention, Move, Multikey, Note, Object as Object$1, Offer, OrderedCollection, OrderedCollectionPage, Organization, Page, Person, Place, Profile, PropertyValue, Question, Read, Reject, Relationship, Remove, Service, Source, TentativeAccept, TentativeReject, Tombstone, Travel, Undo, Update, Video, View } from "./vocab-BCWe1Ih5.js";
|
5
|
+
import { Actor, ActorTypeName, GetActorHandleOptions, NormalizeActorHandleOptions, Recipient, getActorClassByTypeName, getActorHandle, getActorTypeName, isActor, normalizeActorHandle } from "./actor-DqFajh9s.js";
|
6
|
+
import { FetchKeyOptions, FetchKeyResult, HttpMessageSignaturesSpec, HttpMessageSignaturesSpecDeterminer, KeyCache, SignRequestOptions, VerifyRequestOptions, exportJwk, fetchKey, generateCryptoKeyPair, importJwk, signRequest, verifyRequest } from "./http-BbO0ejuk.js";
|
7
|
+
import { DoesActorOwnKeyOptions, GetKeyOwnerOptions, doesActorOwnKey, getKeyOwner } from "./owner-kQRGVXG1.js";
|
8
|
+
import { FediverseHandle, LookupObjectOptions, PUBLIC_COLLECTION, TraverseCollectionOptions, getTypeId, isFediverseHandle, lookupObject, parseFediverseHandle, toAcctUrl, traverseCollection } from "./mod-BlVovdcy.js";
|
9
|
+
import { ResourceDescriptor, lookupWebFinger } from "./mod-Ds0mpFZU.js";
|
10
|
+
import { ActivityTransformer, ActorAliasMapper, ActorCallbackSetters, ActorDispatcher, ActorHandleMapper, ActorKeyPair, ActorKeyPairsDispatcher, AuthorizePredicate, CollectionCallbackSetters, CollectionCounter, CollectionCursor, CollectionDispatcher, ConstructorWithTypeId, Context, CreateExponentialBackoffPolicyOptions, CreateFederationOptions, CustomCollectionCallbackSetters, CustomCollectionCounter, CustomCollectionCursor, CustomCollectionDispatcher, Federatable, Federation, FederationBuilder, FederationFetchOptions, FederationKvPrefixes, FederationOptions, FederationOrigin, FederationQueueOptions, FederationStartQueueOptions, ForwardActivityOptions, GetSignedKeyOptions, IdempotencyKeyCallback, IdempotencyStrategy, InboxContext, InboxErrorHandler, InboxListener, InboxListenerSetters, Message, NodeInfoDispatcher, ObjectAuthorizePredicate, ObjectCallbackSetters, ObjectDispatcher, OutboxErrorHandler, PageItems, ParseUriResult, RequestContext, RespondWithObjectOptions, RetryContext, RetryPolicy, Rfc6570Expression, RouteActivityOptions, Router, RouterError, RouterOptions, RouterRouteResult, SendActivityOptions, SendActivityOptionsForCollection, SenderKeyPair, SharedInboxKeyDispatcher, WebFingerLinksDispatcher, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, digest, respondWithObject, respondWithObjectIfAcceptable } from "./context-DG0huGW-.js";
|
11
|
+
import { KvKey, KvStore, KvStoreSetOptions, MemoryKvStore } from "./kv-BKNZ-Tb-.js";
|
12
|
+
import { InProcessMessageQueue, InProcessMessageQueueOptions, MessageQueue, MessageQueueEnqueueOptions, MessageQueueListenOptions, ParallelMessageQueue } from "./mq-CUKlBw08.js";
|
13
|
+
import { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers } from "./mod-BoHnwOCs.js";
|
14
|
+
import "./mod-CVgZgliM.js";
|
15
|
+
import "./mod-xIj-IT58.js";
|
16
|
+
import { CreateProofOptions, CreateSignatureOptions, SignJsonLdOptions, SignObjectOptions, VerifyJsonLdOptions, VerifyObjectOptions, VerifyProofOptions, VerifySignatureOptions, attachSignature, createProof, createSignature, detachSignature, signJsonLd, signObject, verifyJsonLd, verifyObject, verifyProof, verifySignature } from "./mod-B2iOw50L.js";
|
17
|
+
import { getAuthenticatedDocumentLoader, kvCache } from "./mod-B9M-8jm2.js";
|
18
|
+
export { Accept, Activity, ActivityTransformer, Actor, ActorAliasMapper, ActorCallbackSetters, ActorDispatcher, ActorHandleMapper, ActorKeyPair, ActorKeyPairsDispatcher, ActorTypeName, Add, Announce, Application, Arrive, Article, Audio, AuthorizePredicate, Block, ChatMessage, Collection, CollectionCallbackSetters, CollectionCounter, CollectionCursor, CollectionDispatcher, CollectionPage, ConstructorWithTypeId, Context, Create, CreateExponentialBackoffPolicyOptions, CreateFederationOptions, CreateProofOptions, CreateSignatureOptions, CryptographicKey, CustomCollectionCallbackSetters, CustomCollectionCounter, CustomCollectionCursor, CustomCollectionDispatcher, DataIntegrityProof, Delete, DidService, Dislike, Document, DoesActorOwnKeyOptions, Emoji, EmojiReact, Endpoints, Event, Export, Federatable, Federation, FederationBuilder, FederationFetchOptions, FederationKvPrefixes, FederationOptions, FederationOrigin, FederationQueueOptions, FederationStartQueueOptions, FediverseHandle, FetchKeyOptions, FetchKeyResult, Flag, Follow, ForwardActivityOptions, GetActorHandleOptions, GetKeyOwnerOptions, GetNodeInfoOptions, GetSignedKeyOptions, Group, Hashtag, HttpMessageSignaturesSpec, HttpMessageSignaturesSpecDeterminer, IdempotencyKeyCallback, IdempotencyStrategy, Ignore, Image, InProcessMessageQueue, InProcessMessageQueueOptions, InboundService, InboxContext, InboxErrorHandler, InboxListener, InboxListenerSetters, IntransitiveActivity, Invite, Join, JsonValue, KeyCache, KvKey, KvStore, KvStoreSetOptions, Leave, Like, Link, Listen, LookupObjectOptions, MemoryKvStore, Mention, Message, MessageQueue, MessageQueueEnqueueOptions, MessageQueueListenOptions, Move, Multikey, NodeInfo, NodeInfoDispatcher, NormalizeActorHandleOptions, Note, Object$1 as Object, ObjectAuthorizePredicate, ObjectCallbackSetters, ObjectDispatcher, Offer, OrderedCollection, OrderedCollectionPage, Organization, OutboundService, OutboxErrorHandler, PUBLIC_COLLECTION, Page, PageItems, ParallelMessageQueue, ParseNodeInfoOptions, ParseUriResult, Person, Place, Profile, PropertyValue, Protocol, Question, Read, Recipient, Reject, Relationship, Remove, RequestContext, ResourceDescriptor, RespondWithObjectOptions, RetryContext, RetryPolicy, Rfc6570Expression, RouteActivityOptions, Router, RouterError, RouterOptions, RouterRouteResult, SendActivityOptions, SendActivityOptionsForCollection, SenderKeyPair, Service, Services, SharedInboxKeyDispatcher, SignJsonLdOptions, SignObjectOptions, SignRequestOptions, Software, Source, TentativeAccept, TentativeReject, Tombstone, Travel, TraverseCollectionOptions, Undo, Update, Usage, VerifyJsonLdOptions, VerifyObjectOptions, VerifyProofOptions, VerifyRequestOptions, VerifySignatureOptions, Video, View, WebFingerLinksDispatcher, actorDehydrator, attachSignature, autoIdAssigner, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, createProof, createSignature, detachSignature, digest, doesActorOwnKey, exportJwk, fetchKey, generateCryptoKeyPair, getActorClassByTypeName, getActorHandle, getActorTypeName, getAuthenticatedDocumentLoader, getDefaultActivityTransformers, getKeyOwner, getNodeInfo, getTypeId, importJwk, isActor, isFediverseHandle, kvCache, lookupObject, lookupWebFinger, nodeInfoToJson, normalizeActorHandle, parseFediverseHandle, parseNodeInfo, respondWithObject, respondWithObjectIfAcceptable, signJsonLd, signObject, signRequest, toAcctUrl, traverseCollection, verifyJsonLd, verifyObject, verifyProof, verifyRequest, verifySignature };
|
package/dist/mod.js
CHANGED
@@ -1,23 +1,21 @@
|
|
1
1
|
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
import { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers } from "./transformers-
|
6
|
-
import "./compat-
|
7
|
-
import {
|
8
|
-
import { Accept, Activity, Add, Announce, Application, Arrive, Article, Audio, Block, ChatMessage, Collection, CollectionPage, Create, CryptographicKey, DataIntegrityProof, Delete, DidService, Dislike, Document, Emoji, EmojiReact, Endpoints, Event, Export, Flag, Follow, Group, Hashtag, Ignore, Image, IntransitiveActivity, Invite, Join,
|
9
|
-
import { Router, RouterError, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, digest, respondWithObject, respondWithObjectIfAcceptable } from "./middleware-
|
10
|
-
import {
|
11
|
-
import {
|
12
|
-
import {
|
13
|
-
import {
|
14
|
-
import {
|
15
|
-
import {
|
16
|
-
import
|
17
|
-
import
|
18
|
-
import "./
|
19
|
-
import "./
|
20
|
-
import "./sig-BXJO--F9.js";
|
21
|
-
import "./webfinger-C3GIyXIg.js";
|
2
|
+
import { Temporal } from "@js-temporal/polyfill";
|
3
|
+
import { URLPattern } from "urlpattern-polyfill";
|
4
|
+
|
5
|
+
import { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers } from "./transformers-BFT6d7J5.js";
|
6
|
+
import "./compat-nxUqe4Z-.js";
|
7
|
+
import { lookupWebFinger } from "./lookup-CHkCVZTU.js";
|
8
|
+
import { Accept, Activity, Add, Announce, Application, Arrive, Article, Audio, Block, ChatMessage, Collection, CollectionPage, Create, CryptographicKey, DataIntegrityProof, Delete, DidService, Dislike, Document, Emoji, EmojiReact, Endpoints, Event, Export, Flag, Follow, Group, Hashtag, Ignore, Image, IntransitiveActivity, Invite, Join, Leave, Like, Link, Listen, Mention, Move, Multikey, Note, Object as Object$1, Offer, OrderedCollection, OrderedCollectionPage, Organization, Page, Person, Place, Profile, PropertyValue, Question, Read, Reject, Relationship, Remove, Service, Source, TentativeAccept, TentativeReject, Tombstone, Travel, Undo, Update, Video, View, getActorClassByTypeName, getActorHandle, getActorTypeName, getTypeId, isActor, normalizeActorHandle } from "./actor-DzhunPC_.js";
|
9
|
+
import { Router, RouterError, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, digest, respondWithObject, respondWithObjectIfAcceptable } from "./middleware-DMk2Mdn9.js";
|
10
|
+
import { exportJwk, fetchKey, generateCryptoKeyPair, importJwk, signRequest, verifyRequest } from "./http-CUVx-vzb.js";
|
11
|
+
import { attachSignature, createProof, createSignature, detachSignature, doesActorOwnKey, getKeyOwner, signJsonLd, signObject, verifyJsonLd, verifyObject, verifyProof, verifySignature } from "./proof-fqzaMJ4g.js";
|
12
|
+
import { InProcessMessageQueue, MemoryKvStore, ParallelMessageQueue } from "./federation-jcR8-ZxP.js";
|
13
|
+
import { getNodeInfo, nodeInfoToJson, parseNodeInfo } from "./types-BtUjyi5y.js";
|
14
|
+
import { getAuthenticatedDocumentLoader, kvCache } from "./kv-cache-CGXcDejL.js";
|
15
|
+
import { PUBLIC_COLLECTION, isFediverseHandle, lookupObject, parseFediverseHandle, toAcctUrl, traverseCollection } from "./vocab-BnR3nIU9.js";
|
16
|
+
import "./nodeinfo-BnthBobC.js";
|
17
|
+
import "./sig-C34-oHBl.js";
|
18
|
+
import "./utils-D-Va7aXC.js";
|
19
|
+
import "./webfinger-C72Y8lrh.js";
|
22
20
|
|
23
|
-
export { Accept, Activity, Add, Announce, Application, Arrive, Article, Audio, Block, ChatMessage, Collection, CollectionPage, Create, CryptographicKey, DataIntegrityProof, Delete, DidService, Dislike, Document, Emoji, EmojiReact, Endpoints, Event, Export,
|
21
|
+
export { Accept, Activity, Add, Announce, Application, Arrive, Article, Audio, Block, ChatMessage, Collection, CollectionPage, Create, CryptographicKey, DataIntegrityProof, Delete, DidService, Dislike, Document, Emoji, EmojiReact, Endpoints, Event, Export, Flag, Follow, Group, Hashtag, Ignore, Image, InProcessMessageQueue, IntransitiveActivity, Invite, Join, Leave, Like, Link, Listen, MemoryKvStore, Mention, Move, Multikey, Note, Object$1 as Object, Offer, OrderedCollection, OrderedCollectionPage, Organization, PUBLIC_COLLECTION, Page, ParallelMessageQueue, Person, Place, Profile, PropertyValue, Question, Read, Reject, Relationship, Remove, Router, RouterError, Service, Source, TentativeAccept, TentativeReject, Tombstone, Travel, Undo, Update, Video, View, actorDehydrator, attachSignature, autoIdAssigner, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, createProof, createSignature, detachSignature, digest, doesActorOwnKey, exportJwk, fetchKey, generateCryptoKeyPair, getActorClassByTypeName, getActorHandle, getActorTypeName, getAuthenticatedDocumentLoader, getDefaultActivityTransformers, getKeyOwner, getNodeInfo, getTypeId, importJwk, isActor, isFediverseHandle, kvCache, lookupObject, lookupWebFinger, nodeInfoToJson, normalizeActorHandle, parseFediverseHandle, parseNodeInfo, respondWithObject, respondWithObjectIfAcceptable, signJsonLd, signObject, signRequest, toAcctUrl, traverseCollection, verifyJsonLd, verifyObject, verifyProof, verifyRequest, verifySignature };
|
@@ -0,0 +1,140 @@
|
|
1
|
+
//#region src/federation/mq.d.ts
|
2
|
+
/**
|
3
|
+
* Additional options for enqueuing a message in a queue.
|
4
|
+
*
|
5
|
+
* @since 0.5.0
|
6
|
+
*/
|
7
|
+
interface MessageQueueEnqueueOptions {
|
8
|
+
/**
|
9
|
+
* The delay before the message is enqueued. No delay by default.
|
10
|
+
*
|
11
|
+
* It must not be negative.
|
12
|
+
*/
|
13
|
+
delay?: Temporal.Duration;
|
14
|
+
}
|
15
|
+
/**
|
16
|
+
* Additional options for listening to a message queue.
|
17
|
+
*
|
18
|
+
* @since 1.0.0
|
19
|
+
*/
|
20
|
+
interface MessageQueueListenOptions {
|
21
|
+
/**
|
22
|
+
* The signal to abort listening to the message queue.
|
23
|
+
*/
|
24
|
+
signal?: AbortSignal;
|
25
|
+
}
|
26
|
+
/**
|
27
|
+
* An abstract interface for a message queue.
|
28
|
+
*
|
29
|
+
* @since 0.5.0
|
30
|
+
*/
|
31
|
+
interface MessageQueue {
|
32
|
+
/**
|
33
|
+
* Whether the message queue backend provides native retry mechanisms.
|
34
|
+
* When `true`, Fedify will skip its own retry logic and rely on the backend
|
35
|
+
* to handle retries. When `false` or omitted, Fedify will handle retries
|
36
|
+
* using its own retry policies.
|
37
|
+
*
|
38
|
+
* @default `false`
|
39
|
+
* @since 1.7.0
|
40
|
+
*/
|
41
|
+
readonly nativeRetrial?: boolean;
|
42
|
+
/**
|
43
|
+
* Enqueues a message in the queue.
|
44
|
+
* @param message The message to enqueue.
|
45
|
+
* @param options Additional options for enqueuing the message.
|
46
|
+
*/
|
47
|
+
enqueue(message: any, options?: MessageQueueEnqueueOptions): Promise<void>;
|
48
|
+
/**
|
49
|
+
* Enqueues multiple messages in the queue. This operation is optional,
|
50
|
+
* and may not be supported by all implementations. If not supported,
|
51
|
+
* Fedify will invoke {@link enqueue} for each message.
|
52
|
+
*
|
53
|
+
* @param messages The messages to enqueue.
|
54
|
+
* @param options Additional options for enqueuing the messages.
|
55
|
+
*/
|
56
|
+
enqueueMany?: (messages: any[], options?: MessageQueueEnqueueOptions) => Promise<void>;
|
57
|
+
/**
|
58
|
+
* Listens for messages in the queue.
|
59
|
+
* @param handler The handler for messages in the queue.
|
60
|
+
* @param options Additional options for listening to the message queue.
|
61
|
+
* @returns A promise that resolves when the listening is done. It never
|
62
|
+
* rejects, and is resolved when the signal is aborted. If no
|
63
|
+
* signal is provided, it never resolves.
|
64
|
+
*/
|
65
|
+
listen(handler: (message: any) => Promise<void> | void, options?: MessageQueueListenOptions): Promise<void>;
|
66
|
+
}
|
67
|
+
/**
|
68
|
+
* Additional options for {@link InProcessMessageQueue}.
|
69
|
+
* @since 1.0.0
|
70
|
+
*/
|
71
|
+
interface InProcessMessageQueueOptions {
|
72
|
+
/**
|
73
|
+
* The interval to poll for messages in the queue. 5 seconds by default.
|
74
|
+
* @default `{ seconds: 5 }`
|
75
|
+
*/
|
76
|
+
pollInterval?: Temporal.Duration | Temporal.DurationLike;
|
77
|
+
}
|
78
|
+
/**
|
79
|
+
* A message queue that processes messages in the same process.
|
80
|
+
* Do not use this in production as it does neither persist messages nor
|
81
|
+
* distribute them across multiple processes.
|
82
|
+
*
|
83
|
+
* @since 0.5.0
|
84
|
+
*/
|
85
|
+
declare class InProcessMessageQueue implements MessageQueue {
|
86
|
+
#private;
|
87
|
+
/**
|
88
|
+
* In-process message queue does not provide native retry mechanisms.
|
89
|
+
* @since 1.7.0
|
90
|
+
*/
|
91
|
+
readonly nativeRetrial = false;
|
92
|
+
/**
|
93
|
+
* Constructs a new {@link InProcessMessageQueue} with the given options.
|
94
|
+
* @param options Additional options for the in-process message queue.
|
95
|
+
*/
|
96
|
+
constructor(options?: InProcessMessageQueueOptions);
|
97
|
+
enqueue(message: any, options?: MessageQueueEnqueueOptions): Promise<void>;
|
98
|
+
enqueueMany(messages: any[], options?: MessageQueueEnqueueOptions): Promise<void>;
|
99
|
+
listen(handler: (message: any) => Promise<void> | void, options?: MessageQueueListenOptions): Promise<void>;
|
100
|
+
}
|
101
|
+
/**
|
102
|
+
* A message queue that processes messages in parallel. It takes another
|
103
|
+
* {@link MessageQueue}, and processes messages in parallel up to a certain
|
104
|
+
* number of workers.
|
105
|
+
*
|
106
|
+
* Actually, it's rather a decorator than a queue itself.
|
107
|
+
*
|
108
|
+
* Note that the workers do not run in truly parallel, in the sense that they
|
109
|
+
* are not running in separate threads or processes. They are running in the
|
110
|
+
* same process, but are scheduled to run in parallel. Hence, this is useful
|
111
|
+
* for I/O-bound tasks, but not for CPU-bound tasks, which is okay for Fedify's
|
112
|
+
* workloads.
|
113
|
+
*
|
114
|
+
* @since 1.0.0
|
115
|
+
*/
|
116
|
+
declare class ParallelMessageQueue implements MessageQueue {
|
117
|
+
#private;
|
118
|
+
readonly queue: MessageQueue;
|
119
|
+
readonly workers: number;
|
120
|
+
/**
|
121
|
+
* Inherits the native retry capability from the wrapped queue.
|
122
|
+
* @since 1.7.0
|
123
|
+
*/
|
124
|
+
readonly nativeRetrial?: boolean;
|
125
|
+
/**
|
126
|
+
* Constructs a new {@link ParallelMessageQueue} with the given queue and
|
127
|
+
* number of workers.
|
128
|
+
* @param queue The message queue to use under the hood. Note that
|
129
|
+
* {@link ParallelMessageQueue} cannot be nested.
|
130
|
+
* @param workers The number of workers to process messages in parallel.
|
131
|
+
* @throws {TypeError} If the given queue is an instance of
|
132
|
+
* {@link ParallelMessageQueue}.
|
133
|
+
*/
|
134
|
+
constructor(queue: MessageQueue, workers: number);
|
135
|
+
enqueue(message: any, options?: MessageQueueEnqueueOptions): Promise<void>;
|
136
|
+
enqueueMany(messages: any[], options?: MessageQueueEnqueueOptions): Promise<void>;
|
137
|
+
listen(handler: (message: any) => Promise<void> | void, options?: MessageQueueListenOptions): Promise<void>;
|
138
|
+
}
|
139
|
+
//#endregion
|
140
|
+
export { InProcessMessageQueue, InProcessMessageQueueOptions, MessageQueue, MessageQueueEnqueueOptions, MessageQueueListenOptions, ParallelMessageQueue };
|
@@ -0,0 +1,71 @@
|
|
1
|
+
|
2
|
+
import { Temporal } from "@js-temporal/polyfill";
|
3
|
+
import { URLPattern } from "urlpattern-polyfill";
|
4
|
+
globalThis.addEventListener = () => {};
|
5
|
+
|
6
|
+
//#region src/federation/negotiation.ts
|
7
|
+
function compareSpecs(a, b) {
|
8
|
+
return b.q - a.q || (b.s ?? 0) - (a.s ?? 0) || (a.o ?? 0) - (b.o ?? 0) || a.i - b.i || 0;
|
9
|
+
}
|
10
|
+
function isQuality(spec) {
|
11
|
+
return spec.q > 0;
|
12
|
+
}
|
13
|
+
const simpleMediaTypeRegExp = /^\s*([^\s\/;]+)\/([^;\s]+)\s*(?:;(.*))?$/;
|
14
|
+
function splitKeyValuePair(str) {
|
15
|
+
const [key, value] = str.split("=");
|
16
|
+
return [key.toLowerCase(), value];
|
17
|
+
}
|
18
|
+
function parseMediaType(str, i) {
|
19
|
+
const match = simpleMediaTypeRegExp.exec(str);
|
20
|
+
if (!match) return;
|
21
|
+
const [, type, subtype, parameters] = match;
|
22
|
+
if (!type || !subtype) return;
|
23
|
+
const params = Object.create(null);
|
24
|
+
let q = 1;
|
25
|
+
if (parameters) {
|
26
|
+
const kvps = parameters.split(";").map((p) => p.trim()).map(splitKeyValuePair);
|
27
|
+
for (const [key, val] of kvps) {
|
28
|
+
const value = val && val[0] === `"` && val[val.length - 1] === `"` ? val.slice(1, val.length - 1) : val;
|
29
|
+
if (key === "q" && value) {
|
30
|
+
q = parseFloat(value);
|
31
|
+
break;
|
32
|
+
}
|
33
|
+
params[key] = value;
|
34
|
+
}
|
35
|
+
}
|
36
|
+
return {
|
37
|
+
type,
|
38
|
+
subtype,
|
39
|
+
params,
|
40
|
+
i,
|
41
|
+
o: void 0,
|
42
|
+
q,
|
43
|
+
s: void 0
|
44
|
+
};
|
45
|
+
}
|
46
|
+
function parseAccept(accept) {
|
47
|
+
const accepts = accept.split(",").map((p) => p.trim());
|
48
|
+
const mediaTypes = [];
|
49
|
+
for (const [index, accept$1] of accepts.entries()) {
|
50
|
+
const mediaType = parseMediaType(accept$1.trim(), index);
|
51
|
+
if (mediaType) mediaTypes.push(mediaType);
|
52
|
+
}
|
53
|
+
return mediaTypes;
|
54
|
+
}
|
55
|
+
function getFullType(spec) {
|
56
|
+
return `${spec.type}/${spec.subtype}`;
|
57
|
+
}
|
58
|
+
function preferredMediaTypes(accept) {
|
59
|
+
const accepts = parseAccept(accept === void 0 ? "*/*" : accept ?? "");
|
60
|
+
return accepts.filter(isQuality).sort(compareSpecs).map(getFullType);
|
61
|
+
}
|
62
|
+
function acceptsJsonLd(request) {
|
63
|
+
const accept = request.headers.get("Accept");
|
64
|
+
const types = accept ? preferredMediaTypes(accept) : ["*/*"];
|
65
|
+
if (types == null) return true;
|
66
|
+
if (types[0] === "text/html" || types[0] === "application/xhtml+xml") return false;
|
67
|
+
return types.includes("application/activity+json") || types.includes("application/ld+json") || types.includes("application/json");
|
68
|
+
}
|
69
|
+
|
70
|
+
//#endregion
|
71
|
+
export { acceptsJsonLd };
|
@@ -3,20 +3,17 @@
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
globalThis.addEventListener = () => {};
|
5
5
|
|
6
|
-
import "../
|
6
|
+
import "../lookup-DQRtjvb1.js";
|
7
7
|
import { assertEquals } from "../assert_equals-DSbWqCm3.js";
|
8
8
|
import "../assert-MZs1qjMx.js";
|
9
9
|
import "../assert_instance_of-DHz7EHNU.js";
|
10
|
-
import "../
|
11
|
-
import {
|
12
|
-
import "../
|
13
|
-
import
|
14
|
-
import "../
|
15
|
-
import "../
|
16
|
-
import "../
|
17
|
-
import "../assert_not_equals-f3m3epl3.js";
|
18
|
-
import "../assert_throws-BOO88avQ.js";
|
19
|
-
import { esm_default } from "../esm-CHdxdkuH.js";
|
10
|
+
import { getNodeInfo, parseInboundService, parseNodeInfo, parseOutboundService, parseProtocol, parseServices, parseSoftware, parseUsage } from "../client-pY7-3icS.js";
|
11
|
+
import { test } from "../testing-g4UC4liW.js";
|
12
|
+
import "../std__assert-DWivtrGR.js";
|
13
|
+
import "../assert_rejects-Ce45JcFg.js";
|
14
|
+
import "../assert_throws-BNXdRGWP.js";
|
15
|
+
import "../assert_not_equals-C80BG-_5.js";
|
16
|
+
import { esm_default } from "../esm-C-Qa1zEM.js";
|
20
17
|
|
21
18
|
//#region src/nodeinfo/client.test.ts
|
22
19
|
test("getNodeInfo()", async (t) => {
|
@@ -42,13 +39,7 @@ test("getNodeInfo()", async (t) => {
|
|
42
39
|
const expected = {
|
43
40
|
software: {
|
44
41
|
name: "foo",
|
45
|
-
version:
|
46
|
-
major: 1,
|
47
|
-
minor: 2,
|
48
|
-
patch: 3,
|
49
|
-
build: [],
|
50
|
-
prerelease: []
|
51
|
-
}
|
42
|
+
version: "1.2.3"
|
52
43
|
},
|
53
44
|
protocols: ["activitypub", "diaspora"],
|
54
45
|
usage: {
|
@@ -126,13 +117,7 @@ test("parseNodeInfo()", () => {
|
|
126
117
|
const output = {
|
127
118
|
software: {
|
128
119
|
name: "foo",
|
129
|
-
version:
|
130
|
-
major: 1,
|
131
|
-
minor: 2,
|
132
|
-
patch: 3,
|
133
|
-
build: [],
|
134
|
-
prerelease: []
|
135
|
-
},
|
120
|
+
version: "1.2.3",
|
136
121
|
repository: new URL("https://codeberg.org/foo/foo"),
|
137
122
|
homepage: new URL("https://foo.example")
|
138
123
|
},
|
@@ -294,13 +279,7 @@ test("parseSoftware()", () => {
|
|
294
279
|
homepage: "https://foo.example"
|
295
280
|
}), {
|
296
281
|
name: "foo",
|
297
|
-
version:
|
298
|
-
major: 1,
|
299
|
-
minor: 2,
|
300
|
-
patch: 3,
|
301
|
-
build: [],
|
302
|
-
prerelease: []
|
303
|
-
},
|
282
|
+
version: "1.2.3",
|
304
283
|
repository: new URL("https://codeberg.org/foo/foo"),
|
305
284
|
homepage: new URL("https://foo.example")
|
306
285
|
});
|
@@ -309,13 +288,7 @@ test("parseSoftware()", () => {
|
|
309
288
|
version: "4.5.6-beta.7+build.8"
|
310
289
|
}), {
|
311
290
|
name: "foo",
|
312
|
-
version:
|
313
|
-
major: 4,
|
314
|
-
minor: 5,
|
315
|
-
patch: 6,
|
316
|
-
build: ["build", "8"],
|
317
|
-
prerelease: ["beta", 7]
|
318
|
-
}
|
291
|
+
version: "4.5.6-beta.7+build.8"
|
319
292
|
});
|
320
293
|
assertEquals(parseSoftware(123), null);
|
321
294
|
assertEquals(parseSoftware(123, { tryBestEffort: true }), null);
|
@@ -326,73 +299,49 @@ test("parseSoftware()", () => {
|
|
326
299
|
assertEquals(parseSoftware({ name: " FOO " }), null);
|
327
300
|
assertEquals(parseSoftware({ name: " FOO " }, { tryBestEffort: true }), {
|
328
301
|
name: "foo",
|
329
|
-
version:
|
330
|
-
major: 0,
|
331
|
-
minor: 0,
|
332
|
-
patch: 0,
|
333
|
-
build: [],
|
334
|
-
prerelease: []
|
335
|
-
}
|
302
|
+
version: "0.0.0"
|
336
303
|
});
|
337
304
|
assertEquals(parseSoftware({
|
338
305
|
name: "foo",
|
339
306
|
version: 123
|
340
|
-
}),
|
307
|
+
}), {
|
308
|
+
name: "foo",
|
309
|
+
version: "123"
|
310
|
+
});
|
341
311
|
assertEquals(parseSoftware({
|
342
312
|
name: "foo",
|
343
313
|
version: 123
|
344
314
|
}, { tryBestEffort: true }), {
|
345
315
|
name: "foo",
|
346
|
-
version:
|
347
|
-
major: 0,
|
348
|
-
minor: 0,
|
349
|
-
patch: 0,
|
350
|
-
build: [],
|
351
|
-
prerelease: []
|
352
|
-
}
|
316
|
+
version: "123"
|
353
317
|
});
|
354
318
|
assertEquals(parseSoftware({
|
355
319
|
name: "foo",
|
356
320
|
version: "abc"
|
357
|
-
}),
|
321
|
+
}), {
|
322
|
+
name: "foo",
|
323
|
+
version: "abc"
|
324
|
+
});
|
358
325
|
assertEquals(parseSoftware({
|
359
326
|
name: "foo",
|
360
327
|
version: "abc"
|
361
328
|
}, { tryBestEffort: true }), {
|
362
329
|
name: "foo",
|
363
|
-
version:
|
364
|
-
major: 0,
|
365
|
-
minor: 0,
|
366
|
-
patch: 0,
|
367
|
-
build: [],
|
368
|
-
prerelease: []
|
369
|
-
}
|
330
|
+
version: "abc"
|
370
331
|
});
|
371
332
|
assertEquals(parseSoftware({
|
372
333
|
name: "foo",
|
373
334
|
version: " 1.2.3 "
|
374
335
|
}), {
|
375
336
|
name: "foo",
|
376
|
-
version:
|
377
|
-
major: 1,
|
378
|
-
minor: 2,
|
379
|
-
patch: 3,
|
380
|
-
build: [],
|
381
|
-
prerelease: []
|
382
|
-
}
|
337
|
+
version: " 1.2.3 "
|
383
338
|
});
|
384
339
|
assertEquals(parseSoftware({
|
385
340
|
name: "foo",
|
386
341
|
version: " 1.2.3 "
|
387
342
|
}, { tryBestEffort: true }), {
|
388
343
|
name: "foo",
|
389
|
-
version:
|
390
|
-
major: 1,
|
391
|
-
minor: 2,
|
392
|
-
patch: 3,
|
393
|
-
build: [],
|
394
|
-
prerelease: []
|
395
|
-
}
|
344
|
+
version: " 1.2.3 "
|
396
345
|
});
|
397
346
|
assertEquals(parseSoftware({
|
398
347
|
name: "foo",
|
@@ -411,13 +360,7 @@ test("parseSoftware()", () => {
|
|
411
360
|
homepage: 456
|
412
361
|
}, { tryBestEffort: true }), {
|
413
362
|
name: "foo",
|
414
|
-
version:
|
415
|
-
major: 1,
|
416
|
-
minor: 2,
|
417
|
-
patch: 3,
|
418
|
-
build: [],
|
419
|
-
prerelease: []
|
420
|
-
}
|
363
|
+
version: "1.2.3"
|
421
364
|
});
|
422
365
|
assertEquals(parseSoftware({
|
423
366
|
name: "foo",
|
@@ -436,13 +379,7 @@ test("parseSoftware()", () => {
|
|
436
379
|
homepage: ""
|
437
380
|
}, { tryBestEffort: true }), {
|
438
381
|
name: "foo",
|
439
|
-
version:
|
440
|
-
major: 1,
|
441
|
-
minor: 2,
|
442
|
-
patch: 3,
|
443
|
-
build: [],
|
444
|
-
prerelease: []
|
445
|
-
}
|
382
|
+
version: "1.2.3"
|
446
383
|
});
|
447
384
|
assertEquals(parseSoftware({
|
448
385
|
name: "foo",
|
@@ -451,13 +388,7 @@ test("parseSoftware()", () => {
|
|
451
388
|
homepage: ""
|
452
389
|
}, { tryBestEffort: true }), {
|
453
390
|
name: "foo",
|
454
|
-
version:
|
455
|
-
major: 2,
|
456
|
-
minor: 81,
|
457
|
-
patch: 0,
|
458
|
-
build: [],
|
459
|
-
prerelease: []
|
460
|
-
}
|
391
|
+
version: "2.81"
|
461
392
|
});
|
462
393
|
assertEquals(parseSoftware({
|
463
394
|
name: "foo",
|
@@ -466,13 +397,7 @@ test("parseSoftware()", () => {
|
|
466
397
|
homepage: ""
|
467
398
|
}, { tryBestEffort: true }), {
|
468
399
|
name: "foo",
|
469
|
-
version:
|
470
|
-
major: 3,
|
471
|
-
minor: 0,
|
472
|
-
patch: 0,
|
473
|
-
build: [],
|
474
|
-
prerelease: []
|
475
|
-
}
|
400
|
+
version: "3"
|
476
401
|
});
|
477
402
|
assertEquals(parseSoftware({
|
478
403
|
name: "foo",
|
@@ -481,13 +406,7 @@ test("parseSoftware()", () => {
|
|
481
406
|
homepage: ""
|
482
407
|
}, { tryBestEffort: true }), {
|
483
408
|
name: "foo",
|
484
|
-
version:
|
485
|
-
major: 2,
|
486
|
-
minor: 1,
|
487
|
-
patch: 3,
|
488
|
-
build: [],
|
489
|
-
prerelease: []
|
490
|
-
}
|
409
|
+
version: "2.1.3.4"
|
491
410
|
});
|
492
411
|
});
|
493
412
|
test("parseProtocol()", () => {
|
@@ -3,35 +3,34 @@
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
globalThis.addEventListener = () => {};
|
5
5
|
|
6
|
-
import "../
|
6
|
+
import "../lookup-DQRtjvb1.js";
|
7
7
|
import { assertEquals } from "../assert_equals-DSbWqCm3.js";
|
8
8
|
import "../assert-MZs1qjMx.js";
|
9
9
|
import "../assert_instance_of-DHz7EHNU.js";
|
10
10
|
import { MemoryKvStore } from "../kv-CRZrzyXm.js";
|
11
|
-
import { createFederation, handleNodeInfo, handleNodeInfoJrd } from "../middleware-
|
12
|
-
import
|
13
|
-
import "../
|
14
|
-
import "../
|
15
|
-
import "../
|
16
|
-
import "../
|
17
|
-
import "../
|
18
|
-
import "../
|
19
|
-
import "../
|
20
|
-
import "../
|
21
|
-
import "../
|
22
|
-
import "../
|
23
|
-
import "../
|
24
|
-
import "../
|
25
|
-
import "../
|
26
|
-
import "../
|
27
|
-
import "../retry-
|
28
|
-
import "../send-
|
29
|
-
import { createRequestContext, test } from "../testing-
|
30
|
-
import "../std__assert-
|
31
|
-
import "../assert_rejects-
|
32
|
-
import "../
|
33
|
-
import "../assert_not_equals-
|
34
|
-
import "../assert_throws-BOO88avQ.js";
|
11
|
+
import { createFederation, handleNodeInfo, handleNodeInfoJrd } from "../middleware-CJlj5Olw.js";
|
12
|
+
import "../client-pY7-3icS.js";
|
13
|
+
import "../types-C2XVl6gj.js";
|
14
|
+
import "../actor-BXHc5r-q.js";
|
15
|
+
import "../key-CxdLUFS6.js";
|
16
|
+
import "../http-D2kIm9la.js";
|
17
|
+
import "../ld-CIhvSCCr.js";
|
18
|
+
import "../owner-Dvh7mBvr.js";
|
19
|
+
import "../proof-Dgy35fzc.js";
|
20
|
+
import "../docloader-CrbAy9Oc.js";
|
21
|
+
import "../kv-cache-DN9pfMBe.js";
|
22
|
+
import "../inbox-HjG5peXY.js";
|
23
|
+
import "../builder-u7usRsT3.js";
|
24
|
+
import "../collection-BzWsN9pB.js";
|
25
|
+
import "../keycache-bU7COwsh.js";
|
26
|
+
import "../negotiation-C4nFufNk.js";
|
27
|
+
import "../retry-CfF8Gn4d.js";
|
28
|
+
import "../send-Drp20VO9.js";
|
29
|
+
import { createRequestContext, test } from "../testing-g4UC4liW.js";
|
30
|
+
import "../std__assert-DWivtrGR.js";
|
31
|
+
import "../assert_rejects-Ce45JcFg.js";
|
32
|
+
import "../assert_throws-BNXdRGWP.js";
|
33
|
+
import "../assert_not_equals-C80BG-_5.js";
|
35
34
|
|
36
35
|
//#region src/nodeinfo/handler.test.ts
|
37
36
|
test("handleNodeInfo()", async () => {
|
@@ -46,7 +45,7 @@ test("handleNodeInfo()", async () => {
|
|
46
45
|
const nodeInfoDispatcher = (_ctx) => ({
|
47
46
|
software: {
|
48
47
|
name: "test",
|
49
|
-
version:
|
48
|
+
version: "1.2.3"
|
50
49
|
},
|
51
50
|
protocols: ["activitypub"],
|
52
51
|
usage: {
|
@@ -0,0 +1,10 @@
|
|
1
|
+
|
2
|
+
const { Temporal } = require("@js-temporal/polyfill");
|
3
|
+
const { URLPattern } = require("urlpattern-polyfill");
|
4
|
+
|
5
|
+
const require_types = require('../types-CWgzGaqk.cjs');
|
6
|
+
require('../nodeinfo-CdN0rEnZ.cjs');
|
7
|
+
|
8
|
+
exports.getNodeInfo = require_types.getNodeInfo;
|
9
|
+
exports.nodeInfoToJson = require_types.nodeInfoToJson;
|
10
|
+
exports.parseNodeInfo = require_types.parseNodeInfo;
|