@fedify/fedify 2.0.0-pr.410.1558 → 2.0.0-pr.412.1692
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/dist/actor-CrTGiTZd.cjs +42609 -0
- package/dist/{actor-CkjTCNqi.js → actor-D5S46edz.js} +1 -1
- package/dist/actor-D6K058Tb.d.cts +128 -0
- package/dist/{actor-DmsbGzXS.js → actor-G2S5sPEA.js} +6951 -2127
- package/dist/{actor-C22bXuuC.d.ts → actor-T6RyhRgk.d.ts} +1 -1
- package/dist/{authdocloader-BwV2NPfz.js → authdocloader-C5AvdCCi.js} +6 -6
- package/dist/authdocloader-CQMPmpaO.cjs +58 -0
- package/dist/{authdocloader-BJxkviIL.js → authdocloader-SjwloJUA.js} +3 -3
- package/dist/{builder-DbOVAz8i.js → builder-OA47XRft.js} +10 -4
- package/dist/chunk-DqRYRqnO.cjs +34 -0
- package/dist/{client-DrNZd6r_.js → client-Bmd-i8x8.js} +3 -22
- package/dist/client-CegPX0Rn.d.cts +222 -0
- package/dist/{client-DF8anIB5.d.ts → client-bgSdkFa2.d.ts} +2 -74
- package/dist/compat/mod.cjs +10 -0
- package/dist/compat/mod.d.cts +13 -0
- package/dist/compat/mod.d.ts +8 -8
- package/dist/compat/mod.js +5 -5
- package/dist/compat/transformers.test.js +19 -19
- package/dist/compat-DmDDELst.cjs +4 -0
- package/dist/compat-nxUqe4Z-.js +4 -0
- package/dist/{context-9gCpIkiz.d.ts → context-ByZprN0S.d.ts} +67 -7
- package/dist/context-C5BsZkDr.d.cts +2315 -0
- package/dist/docloader-7Ey7wNHx.cjs +4861 -0
- package/dist/{docloader-DnepZfu_.js → docloader-CkweNhUH.js} +189 -9
- package/dist/docloader-D-MrRyHl.d.cts +219 -0
- package/dist/{esm-D1HqBE3n.js → esm-CwHz8Y8t.js} +1 -1
- package/dist/federation/builder.test.js +6 -7
- package/dist/federation/collection.test.js +4 -4
- package/dist/federation/handler.test.js +23 -143
- package/dist/federation/idempotency.test.js +202 -0
- package/dist/federation/inbox.test.js +4 -4
- package/dist/federation/keycache.test.js +4 -4
- package/dist/federation/kv.test.js +4 -3
- package/dist/federation/middleware.test.js +231 -52
- package/dist/federation/mod.cjs +29 -0
- package/dist/federation/mod.d.cts +13 -0
- package/dist/federation/mod.d.ts +8 -8
- package/dist/federation/mod.js +15 -15
- package/dist/federation/mq.test.js +3 -3
- package/dist/federation/negotiation.test.d.ts +3 -0
- package/dist/federation/negotiation.test.js +28 -0
- package/dist/federation/retry.test.js +3 -3
- package/dist/federation/router.test.js +3 -3
- package/dist/federation/send.test.js +10 -10
- package/dist/{federation-CMX7WzeL.js → federation-D1U8YY9t.js} +3 -3
- package/dist/federation-H2_En3j5.cjs +244 -0
- package/dist/fixtures/media.example.com/avatars/test-avatar.jpg.json +6 -0
- package/dist/http-BiBofurJ.cjs +826 -0
- package/dist/{http-BEJUSX6j.js → http-C5tC93Hn.js} +7 -7
- package/dist/http-D-e6AFwR.d.cts +253 -0
- package/dist/{http-DqSNLFNY.d.ts → http-D6Uj2x2y.d.ts} +1 -1
- package/dist/{http-BgCF3jDs.js → http-DGjdMiLc.js} +3 -3
- package/dist/{inbox-Bq4EChoK.js → inbox-BoDY3z8G.js} +24 -7
- package/dist/key-CZR7QraT.cjs +290 -0
- package/dist/key-Cf8MffVe.cjs +10 -0
- package/dist/{key-D-0OLe9C.js → key-CkxrAIyp.js} +5 -5
- package/dist/key-Dk0j88Jo.js +10 -0
- package/dist/{key-BD3lpBWw.js → key-Epcl5jpz.js} +3 -3
- package/dist/{key-BYNqWXyu.js → key-IxRhZpOF.js} +2 -2
- package/dist/{keycache-yZDAc3-e.js → keycache-TEniXNel.js} +1 -1
- package/dist/{keys-Dtc-g6xq.js → keys-bZxcrZ9Z.js} +1 -1
- package/dist/kv-63Cil1MD.d.cts +81 -0
- package/dist/{ld-BJ484qSg.js → ld-DW7A0uIc.js} +4 -4
- package/dist/{lookup-Cj0sX50U.js → lookup-DhQCVVja.js} +21 -12
- package/dist/lookup-DiV4LFBg.cjs +137 -0
- package/dist/{lookup-BzogF2gp.js → lookup-cVRa2QM-.js} +4 -4
- package/dist/middleware-Be1JStOx.js +17 -0
- package/dist/middleware-CDOK7WOb.js +26 -0
- package/dist/{middleware-CiH0ptqy.js → middleware-Cgr3PtaJ.js} +58 -149
- package/dist/{middleware-DIZ1dnwT.js → middleware-DvvYAIsd.js} +87 -91
- package/dist/middleware-EjIW2mZB.cjs +17 -0
- package/dist/middleware-TfuVoceY.cjs +4231 -0
- package/dist/mod-8DMWKtQE.d.cts +80 -0
- package/dist/{mod-Drmz72EK.d.ts → mod-BhUKmBJD.d.ts} +2 -2
- package/dist/mod-C2tOeRkN.d.cts +1 -0
- package/dist/{mod-TFoH2Ql8.d.ts → mod-CerN_Sza.d.ts} +1 -1
- package/dist/mod-Cj1tHXBR.d.cts +102 -0
- package/dist/mod-CxkWO3Mg.d.cts +307 -0
- package/dist/{mod-Bqxcp7eN.d.ts → mod-D6hQoxC5.d.ts} +2 -2
- package/dist/mod-Djzcw2ry.d.cts +266 -0
- package/dist/{mod-Cxt4Kpf6.d.ts → mod-DlU8ISoa.d.ts} +19 -1
- package/dist/mod-FZd39qVq.d.cts +1 -0
- package/dist/mod-jQ4OODsl.d.cts +113 -0
- package/dist/mod.cjs +150 -0
- package/dist/mod.d.cts +17 -0
- package/dist/mod.d.ts +11 -11
- package/dist/mod.js +21 -21
- package/dist/mq-B7R1Q-M5.d.cts +140 -0
- package/dist/negotiation-5NPJL6zp.js +71 -0
- package/dist/nodeinfo/client.test.js +27 -106
- package/dist/nodeinfo/handler.test.js +20 -20
- package/dist/nodeinfo/mod.cjs +11 -0
- package/dist/nodeinfo/mod.d.cts +5 -0
- package/dist/nodeinfo/mod.d.ts +2 -2
- package/dist/nodeinfo/mod.js +7 -7
- package/dist/nodeinfo/types.test.js +5 -10
- package/dist/nodeinfo-Co9lJrWl.cjs +4 -0
- package/dist/nodeinfo-DfycQ8Wf.js +4 -0
- package/dist/{owner-9FMX4wQT.js → owner-6Vc3UXXE.js} +2 -2
- package/dist/owner-BN_tO3cY.d.cts +67 -0
- package/dist/{owner-CQPnQVtf.d.ts → owner-hd9lvQcP.d.ts} +2 -2
- package/dist/{proof-Arx4Q9Q6.js → proof-C1jhbeNv.js} +3 -3
- package/dist/proof-CRJWXFfT.cjs +673 -0
- package/dist/{proof-DnTD0avk.js → proof-Chi90OXv.js} +9 -9
- package/dist/runtime/authdocloader.test.js +9 -9
- package/dist/runtime/docloader.test.js +4 -4
- package/dist/runtime/key.test.js +5 -5
- package/dist/runtime/langstr.test.js +3 -3
- package/dist/runtime/link.test.d.ts +3 -0
- package/dist/runtime/link.test.js +61 -0
- package/dist/runtime/mod.cjs +25 -0
- package/dist/runtime/mod.d.cts +6 -0
- package/dist/runtime/mod.d.ts +3 -3
- package/dist/runtime/mod.js +10 -10
- package/dist/runtime/multibase/multibase.test.js +3 -3
- package/dist/runtime/url.test.js +3 -3
- package/dist/runtime-C58AJWSv.cjs +4 -0
- package/dist/runtime-DPYEDf-o.js +4 -0
- package/dist/{send-CcxHe0p3.js → send-DjATl6i3.js} +2 -2
- package/dist/sig/http.test.js +9 -9
- package/dist/sig/key.test.js +6 -6
- package/dist/sig/ld.test.js +7 -7
- package/dist/sig/mod.cjs +30 -0
- package/dist/sig/mod.d.cts +8 -0
- package/dist/sig/mod.d.ts +5 -5
- package/dist/sig/mod.js +10 -10
- package/dist/sig/owner.test.js +7 -7
- package/dist/sig/proof.test.js +7 -7
- package/dist/sig-ByHXzqUi.cjs +4 -0
- package/dist/sig-Cj3tk-ig.js +4 -0
- package/dist/testing/docloader.test.js +3 -3
- package/dist/testing/mod.d.ts +273 -28
- package/dist/testing/mod.js +3 -3
- package/dist/{testing-DFgpNAI6.js → testing-BnfPB5T-.js} +2 -2
- package/dist/{transformers-Dna8Fg7k.js → transformers-BFT6d7J5.js} +3 -3
- package/dist/transformers-CoBS-oFG.cjs +116 -0
- package/dist/{type-B2h-NRAo.js → type-NEA09tSC.js} +7262 -2258
- package/dist/{types-BIgY6c-l.js → types-BSuWJsOm.js} +1 -3
- package/dist/types-CmmUQisS.cjs +315 -0
- package/dist/{types-B1QuBj5L.js → types-dLXLjVLf.js} +8 -169
- package/dist/vocab/actor.test.js +5 -5
- package/dist/vocab/lookup.test.js +255 -5
- package/dist/vocab/mod.cjs +87 -0
- package/dist/vocab/mod.d.cts +6 -0
- package/dist/vocab/mod.d.ts +3 -3
- package/dist/vocab/mod.js +7 -7
- package/dist/vocab/type.test.js +3 -3
- package/dist/vocab/vocab.test.js +433 -9
- package/dist/{vocab-SOE1ifCr.d.ts → vocab-BI0Ak5lL.d.ts} +290 -0
- package/dist/vocab-C5Y-0fGj.cjs +291 -0
- package/dist/vocab-Dw1-yVGg.d.cts +14922 -0
- package/dist/{vocab-BREfYr1a.js → vocab-rWbHpc2J.js} +26 -17
- package/dist/webfinger/handler.test.js +19 -19
- package/dist/webfinger/lookup.test.js +4 -4
- package/dist/webfinger/mod.cjs +9 -0
- package/dist/webfinger/mod.d.cts +4 -0
- package/dist/webfinger/mod.js +6 -6
- package/dist/webfinger-BjOEdFPs.cjs +4 -0
- package/dist/webfinger-De_bU0iE.js +4 -0
- package/dist/x/cfworkers.cjs +100 -0
- package/dist/x/cfworkers.d.cts +59 -0
- package/dist/x/cfworkers.js +3 -3
- package/dist/x/cfworkers.test.js +3 -3
- package/dist/x/hono.cjs +61 -0
- package/dist/x/hono.d.cts +54 -0
- package/dist/x/hono.d.ts +7 -7
- package/dist/x/hono.js +3 -3
- package/dist/x/sveltekit.cjs +69 -0
- package/dist/x/sveltekit.d.cts +46 -0
- package/dist/x/sveltekit.d.ts +7 -7
- package/dist/x/sveltekit.js +3 -3
- package/package.json +68 -13
- package/dist/compat-Bb5myD13.js +0 -4
- package/dist/key-BmFoI4_J.js +0 -10
- package/dist/middleware-D2W4gwdv.js +0 -17
- package/dist/middleware-LmK3pQ2z.js +0 -26
- package/dist/nodeinfo/semver.test.js +0 -143
- package/dist/nodeinfo-CyEbLjHs.js +0 -4
- 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/{collection-CSzG2j1P.js → collection-CcnIw1qY.js} +0 -0
- /package/dist/{nodeinfo/semver.test.d.ts → federation/idempotency.test.d.ts} +0 -0
package/dist/mod.js
CHANGED
@@ -1,23 +1,23 @@
|
|
1
1
|
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
import { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers } from "./transformers-
|
6
|
-
import "./compat-
|
7
|
-
import { FetchError, fetchDocumentLoader, getDocumentLoader, getUserAgent, kvCache } from "./docloader-
|
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, LanguageString, 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, exportMultibaseKey, exportSpki, getActorClassByTypeName, getActorHandle, getActorTypeName, getTypeId, importMultibaseKey, importPem, importPkcs1, importSpki, isActor, normalizeActorHandle } from "./actor-
|
9
|
-
import { Router, RouterError, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, digest, respondWithObject, respondWithObjectIfAcceptable } from "./middleware-
|
10
|
-
import { lookupWebFinger } from "./lookup-
|
11
|
-
import { exportJwk, fetchKey, generateCryptoKeyPair, importJwk } from "./key-
|
12
|
-
import { signRequest, verifyRequest } from "./http-
|
13
|
-
import { attachSignature, createProof, createSignature, detachSignature, doesActorOwnKey, getKeyOwner, signJsonLd, signObject, verifyJsonLd, verifyObject, verifyProof, verifySignature } from "./proof-
|
14
|
-
import { InProcessMessageQueue, MemoryKvStore, ParallelMessageQueue } from "./federation-
|
15
|
-
import {
|
16
|
-
import { getAuthenticatedDocumentLoader } from "./authdocloader-
|
17
|
-
import { PUBLIC_COLLECTION, isFediverseHandle, lookupObject, parseFediverseHandle, toAcctUrl, traverseCollection } from "./vocab-
|
18
|
-
import "./nodeinfo-
|
19
|
-
import "./runtime-
|
20
|
-
import "./sig-
|
21
|
-
import "./webfinger-
|
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 { FetchError, fetchDocumentLoader, getDocumentLoader, getUserAgent, kvCache } from "./docloader-CkweNhUH.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, LanguageString, 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, exportMultibaseKey, exportSpki, getActorClassByTypeName, getActorHandle, getActorTypeName, getTypeId, importMultibaseKey, importPem, importPkcs1, importSpki, isActor, normalizeActorHandle } from "./actor-G2S5sPEA.js";
|
9
|
+
import { Router, RouterError, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, digest, respondWithObject, respondWithObjectIfAcceptable } from "./middleware-DvvYAIsd.js";
|
10
|
+
import { lookupWebFinger } from "./lookup-cVRa2QM-.js";
|
11
|
+
import { exportJwk, fetchKey, generateCryptoKeyPair, importJwk } from "./key-CkxrAIyp.js";
|
12
|
+
import { signRequest, verifyRequest } from "./http-C5tC93Hn.js";
|
13
|
+
import { attachSignature, createProof, createSignature, detachSignature, doesActorOwnKey, getKeyOwner, signJsonLd, signObject, verifyJsonLd, verifyObject, verifyProof, verifySignature } from "./proof-Chi90OXv.js";
|
14
|
+
import { InProcessMessageQueue, MemoryKvStore, ParallelMessageQueue } from "./federation-D1U8YY9t.js";
|
15
|
+
import { getNodeInfo, nodeInfoToJson, parseNodeInfo } from "./types-dLXLjVLf.js";
|
16
|
+
import { getAuthenticatedDocumentLoader } from "./authdocloader-C5AvdCCi.js";
|
17
|
+
import { PUBLIC_COLLECTION, isFediverseHandle, lookupObject, parseFediverseHandle, toAcctUrl, traverseCollection } from "./vocab-rWbHpc2J.js";
|
18
|
+
import "./nodeinfo-DfycQ8Wf.js";
|
19
|
+
import "./runtime-DPYEDf-o.js";
|
20
|
+
import "./sig-Cj3tk-ig.js";
|
21
|
+
import "./webfinger-De_bU0iE.js";
|
22
22
|
|
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, FetchError, Flag, Follow, Group, Hashtag, Ignore, Image, InProcessMessageQueue, IntransitiveActivity, Invite, Join, LanguageString, 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, exportMultibaseKey, exportSpki, fetchDocumentLoader, fetchKey,
|
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, FetchError, Flag, Follow, Group, Hashtag, Ignore, Image, InProcessMessageQueue, IntransitiveActivity, Invite, Join, LanguageString, 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, exportMultibaseKey, exportSpki, fetchDocumentLoader, fetchKey, 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, 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,19 @@
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
globalThis.addEventListener = () => {};
|
5
5
|
|
6
|
-
import "../type-
|
6
|
+
import "../type-NEA09tSC.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 { test } from "../testing-DFgpNAI6.js";
|
10
|
+
import { getNodeInfo, parseInboundService, parseNodeInfo, parseOutboundService, parseProtocol, parseServices, parseSoftware, parseUsage } from "../client-Bmd-i8x8.js";
|
11
|
+
import "../lookup-DhQCVVja.js";
|
12
|
+
import { test } from "../testing-BnfPB5T-.js";
|
14
13
|
import "../std__assert-X-_kMxKM.js";
|
15
14
|
import "../assert_rejects-DiIiJbZn.js";
|
16
15
|
import "../assert_is_error-BPGph1Jx.js";
|
17
16
|
import "../assert_not_equals-f3m3epl3.js";
|
18
17
|
import "../assert_throws-BOO88avQ.js";
|
19
|
-
import { esm_default } from "../esm-
|
18
|
+
import { esm_default } from "../esm-CwHz8Y8t.js";
|
20
19
|
|
21
20
|
//#region src/nodeinfo/client.test.ts
|
22
21
|
test("getNodeInfo()", async (t) => {
|
@@ -42,13 +41,7 @@ test("getNodeInfo()", async (t) => {
|
|
42
41
|
const expected = {
|
43
42
|
software: {
|
44
43
|
name: "foo",
|
45
|
-
version:
|
46
|
-
major: 1,
|
47
|
-
minor: 2,
|
48
|
-
patch: 3,
|
49
|
-
build: [],
|
50
|
-
prerelease: []
|
51
|
-
}
|
44
|
+
version: "1.2.3"
|
52
45
|
},
|
53
46
|
protocols: ["activitypub", "diaspora"],
|
54
47
|
usage: {
|
@@ -126,13 +119,7 @@ test("parseNodeInfo()", () => {
|
|
126
119
|
const output = {
|
127
120
|
software: {
|
128
121
|
name: "foo",
|
129
|
-
version:
|
130
|
-
major: 1,
|
131
|
-
minor: 2,
|
132
|
-
patch: 3,
|
133
|
-
build: [],
|
134
|
-
prerelease: []
|
135
|
-
},
|
122
|
+
version: "1.2.3",
|
136
123
|
repository: new URL("https://codeberg.org/foo/foo"),
|
137
124
|
homepage: new URL("https://foo.example")
|
138
125
|
},
|
@@ -294,13 +281,7 @@ test("parseSoftware()", () => {
|
|
294
281
|
homepage: "https://foo.example"
|
295
282
|
}), {
|
296
283
|
name: "foo",
|
297
|
-
version:
|
298
|
-
major: 1,
|
299
|
-
minor: 2,
|
300
|
-
patch: 3,
|
301
|
-
build: [],
|
302
|
-
prerelease: []
|
303
|
-
},
|
284
|
+
version: "1.2.3",
|
304
285
|
repository: new URL("https://codeberg.org/foo/foo"),
|
305
286
|
homepage: new URL("https://foo.example")
|
306
287
|
});
|
@@ -309,13 +290,7 @@ test("parseSoftware()", () => {
|
|
309
290
|
version: "4.5.6-beta.7+build.8"
|
310
291
|
}), {
|
311
292
|
name: "foo",
|
312
|
-
version:
|
313
|
-
major: 4,
|
314
|
-
minor: 5,
|
315
|
-
patch: 6,
|
316
|
-
build: ["build", "8"],
|
317
|
-
prerelease: ["beta", 7]
|
318
|
-
}
|
293
|
+
version: "4.5.6-beta.7+build.8"
|
319
294
|
});
|
320
295
|
assertEquals(parseSoftware(123), null);
|
321
296
|
assertEquals(parseSoftware(123, { tryBestEffort: true }), null);
|
@@ -326,73 +301,49 @@ test("parseSoftware()", () => {
|
|
326
301
|
assertEquals(parseSoftware({ name: " FOO " }), null);
|
327
302
|
assertEquals(parseSoftware({ name: " FOO " }, { tryBestEffort: true }), {
|
328
303
|
name: "foo",
|
329
|
-
version:
|
330
|
-
major: 0,
|
331
|
-
minor: 0,
|
332
|
-
patch: 0,
|
333
|
-
build: [],
|
334
|
-
prerelease: []
|
335
|
-
}
|
304
|
+
version: "0.0.0"
|
336
305
|
});
|
337
306
|
assertEquals(parseSoftware({
|
338
307
|
name: "foo",
|
339
308
|
version: 123
|
340
|
-
}),
|
309
|
+
}), {
|
310
|
+
name: "foo",
|
311
|
+
version: "123"
|
312
|
+
});
|
341
313
|
assertEquals(parseSoftware({
|
342
314
|
name: "foo",
|
343
315
|
version: 123
|
344
316
|
}, { tryBestEffort: true }), {
|
345
317
|
name: "foo",
|
346
|
-
version:
|
347
|
-
major: 0,
|
348
|
-
minor: 0,
|
349
|
-
patch: 0,
|
350
|
-
build: [],
|
351
|
-
prerelease: []
|
352
|
-
}
|
318
|
+
version: "123"
|
353
319
|
});
|
354
320
|
assertEquals(parseSoftware({
|
355
321
|
name: "foo",
|
356
322
|
version: "abc"
|
357
|
-
}),
|
323
|
+
}), {
|
324
|
+
name: "foo",
|
325
|
+
version: "abc"
|
326
|
+
});
|
358
327
|
assertEquals(parseSoftware({
|
359
328
|
name: "foo",
|
360
329
|
version: "abc"
|
361
330
|
}, { tryBestEffort: true }), {
|
362
331
|
name: "foo",
|
363
|
-
version:
|
364
|
-
major: 0,
|
365
|
-
minor: 0,
|
366
|
-
patch: 0,
|
367
|
-
build: [],
|
368
|
-
prerelease: []
|
369
|
-
}
|
332
|
+
version: "abc"
|
370
333
|
});
|
371
334
|
assertEquals(parseSoftware({
|
372
335
|
name: "foo",
|
373
336
|
version: " 1.2.3 "
|
374
337
|
}), {
|
375
338
|
name: "foo",
|
376
|
-
version:
|
377
|
-
major: 1,
|
378
|
-
minor: 2,
|
379
|
-
patch: 3,
|
380
|
-
build: [],
|
381
|
-
prerelease: []
|
382
|
-
}
|
339
|
+
version: " 1.2.3 "
|
383
340
|
});
|
384
341
|
assertEquals(parseSoftware({
|
385
342
|
name: "foo",
|
386
343
|
version: " 1.2.3 "
|
387
344
|
}, { tryBestEffort: true }), {
|
388
345
|
name: "foo",
|
389
|
-
version:
|
390
|
-
major: 1,
|
391
|
-
minor: 2,
|
392
|
-
patch: 3,
|
393
|
-
build: [],
|
394
|
-
prerelease: []
|
395
|
-
}
|
346
|
+
version: " 1.2.3 "
|
396
347
|
});
|
397
348
|
assertEquals(parseSoftware({
|
398
349
|
name: "foo",
|
@@ -411,13 +362,7 @@ test("parseSoftware()", () => {
|
|
411
362
|
homepage: 456
|
412
363
|
}, { tryBestEffort: true }), {
|
413
364
|
name: "foo",
|
414
|
-
version:
|
415
|
-
major: 1,
|
416
|
-
minor: 2,
|
417
|
-
patch: 3,
|
418
|
-
build: [],
|
419
|
-
prerelease: []
|
420
|
-
}
|
365
|
+
version: "1.2.3"
|
421
366
|
});
|
422
367
|
assertEquals(parseSoftware({
|
423
368
|
name: "foo",
|
@@ -436,13 +381,7 @@ test("parseSoftware()", () => {
|
|
436
381
|
homepage: ""
|
437
382
|
}, { tryBestEffort: true }), {
|
438
383
|
name: "foo",
|
439
|
-
version:
|
440
|
-
major: 1,
|
441
|
-
minor: 2,
|
442
|
-
patch: 3,
|
443
|
-
build: [],
|
444
|
-
prerelease: []
|
445
|
-
}
|
384
|
+
version: "1.2.3"
|
446
385
|
});
|
447
386
|
assertEquals(parseSoftware({
|
448
387
|
name: "foo",
|
@@ -451,13 +390,7 @@ test("parseSoftware()", () => {
|
|
451
390
|
homepage: ""
|
452
391
|
}, { tryBestEffort: true }), {
|
453
392
|
name: "foo",
|
454
|
-
version:
|
455
|
-
major: 2,
|
456
|
-
minor: 81,
|
457
|
-
patch: 0,
|
458
|
-
build: [],
|
459
|
-
prerelease: []
|
460
|
-
}
|
393
|
+
version: "2.81"
|
461
394
|
});
|
462
395
|
assertEquals(parseSoftware({
|
463
396
|
name: "foo",
|
@@ -466,13 +399,7 @@ test("parseSoftware()", () => {
|
|
466
399
|
homepage: ""
|
467
400
|
}, { tryBestEffort: true }), {
|
468
401
|
name: "foo",
|
469
|
-
version:
|
470
|
-
major: 3,
|
471
|
-
minor: 0,
|
472
|
-
patch: 0,
|
473
|
-
build: [],
|
474
|
-
prerelease: []
|
475
|
-
}
|
402
|
+
version: "3"
|
476
403
|
});
|
477
404
|
assertEquals(parseSoftware({
|
478
405
|
name: "foo",
|
@@ -481,13 +408,7 @@ test("parseSoftware()", () => {
|
|
481
408
|
homepage: ""
|
482
409
|
}, { tryBestEffort: true }), {
|
483
410
|
name: "foo",
|
484
|
-
version:
|
485
|
-
major: 2,
|
486
|
-
minor: 1,
|
487
|
-
patch: 3,
|
488
|
-
build: [],
|
489
|
-
prerelease: []
|
490
|
-
}
|
411
|
+
version: "2.1.3.4"
|
491
412
|
});
|
492
413
|
});
|
493
414
|
test("parseProtocol()", () => {
|
@@ -3,30 +3,30 @@
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
globalThis.addEventListener = () => {};
|
5
5
|
|
6
|
-
import "../type-
|
6
|
+
import "../type-NEA09tSC.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 "../
|
11
|
+
import { createFederation, handleNodeInfo, handleNodeInfoJrd } from "../middleware-Cgr3PtaJ.js";
|
12
|
+
import "../client-Bmd-i8x8.js";
|
13
|
+
import "../lookup-DhQCVVja.js";
|
14
|
+
import "../types-BSuWJsOm.js";
|
15
|
+
import "../actor-D5S46edz.js";
|
16
|
+
import "../key-IxRhZpOF.js";
|
17
|
+
import "../http-DGjdMiLc.js";
|
18
|
+
import "../authdocloader-SjwloJUA.js";
|
19
|
+
import "../ld-DW7A0uIc.js";
|
20
|
+
import "../owner-6Vc3UXXE.js";
|
21
|
+
import "../proof-C1jhbeNv.js";
|
22
|
+
import "../inbox-BoDY3z8G.js";
|
23
|
+
import "../builder-OA47XRft.js";
|
24
|
+
import "../collection-CcnIw1qY.js";
|
25
|
+
import "../keycache-TEniXNel.js";
|
26
|
+
import "../negotiation-5NPJL6zp.js";
|
27
27
|
import "../retry-D4GJ670a.js";
|
28
|
-
import "../send-
|
29
|
-
import { createRequestContext, test } from "../testing-
|
28
|
+
import "../send-DjATl6i3.js";
|
29
|
+
import { createRequestContext, test } from "../testing-BnfPB5T-.js";
|
30
30
|
import "../std__assert-X-_kMxKM.js";
|
31
31
|
import "../assert_rejects-DiIiJbZn.js";
|
32
32
|
import "../assert_is_error-BPGph1Jx.js";
|
@@ -46,7 +46,7 @@ test("handleNodeInfo()", async () => {
|
|
46
46
|
const nodeInfoDispatcher = (_ctx) => ({
|
47
47
|
software: {
|
48
48
|
name: "test",
|
49
|
-
version:
|
49
|
+
version: "1.2.3"
|
50
50
|
},
|
51
51
|
protocols: ["activitypub"],
|
52
52
|
usage: {
|
@@ -0,0 +1,11 @@
|
|
1
|
+
|
2
|
+
const { Temporal } = require("@js-temporal/polyfill");
|
3
|
+
const { URLPattern } = require("urlpattern-polyfill");
|
4
|
+
|
5
|
+
require('../docloader-7Ey7wNHx.cjs');
|
6
|
+
const require_types = require('../types-CmmUQisS.cjs');
|
7
|
+
require('../nodeinfo-Co9lJrWl.cjs');
|
8
|
+
|
9
|
+
exports.getNodeInfo = require_types.getNodeInfo;
|
10
|
+
exports.nodeInfoToJson = require_types.nodeInfoToJson;
|
11
|
+
exports.parseNodeInfo = require_types.parseNodeInfo;
|
@@ -0,0 +1,5 @@
|
|
1
|
+
import "../kv-63Cil1MD.cjs";
|
2
|
+
import "../docloader-D-MrRyHl.cjs";
|
3
|
+
import { GetNodeInfoOptions, InboundService, JsonValue, NodeInfo, OutboundService, ParseNodeInfoOptions, Protocol, Services, Software, Usage, getNodeInfo, nodeInfoToJson, parseNodeInfo } from "../client-CegPX0Rn.cjs";
|
4
|
+
import "../mod-FZd39qVq.cjs";
|
5
|
+
export { GetNodeInfoOptions, InboundService, JsonValue, NodeInfo, OutboundService, ParseNodeInfoOptions, Protocol, Services, Software, Usage, getNodeInfo, nodeInfoToJson, parseNodeInfo };
|
package/dist/nodeinfo/mod.d.ts
CHANGED
@@ -2,6 +2,6 @@ import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
3
3
|
import "../kv-C7sopW2E.js";
|
4
4
|
import "../docloader-CxWcuWqQ.js";
|
5
|
-
import { GetNodeInfoOptions, InboundService, JsonValue, NodeInfo, OutboundService, ParseNodeInfoOptions, Protocol,
|
5
|
+
import { GetNodeInfoOptions, InboundService, JsonValue, NodeInfo, OutboundService, ParseNodeInfoOptions, Protocol, Services, Software, Usage, getNodeInfo, nodeInfoToJson, parseNodeInfo } from "../client-bgSdkFa2.js";
|
6
6
|
import "../mod-1pDWKvUL.js";
|
7
|
-
export { GetNodeInfoOptions, InboundService, JsonValue, NodeInfo, OutboundService, ParseNodeInfoOptions, Protocol,
|
7
|
+
export { GetNodeInfoOptions, InboundService, JsonValue, NodeInfo, OutboundService, ParseNodeInfoOptions, Protocol, Services, Software, Usage, getNodeInfo, nodeInfoToJson, parseNodeInfo };
|
package/dist/nodeinfo/mod.js
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
import "../docloader-
|
6
|
-
import {
|
7
|
-
import "../nodeinfo-
|
2
|
+
import { Temporal } from "@js-temporal/polyfill";
|
3
|
+
import { URLPattern } from "urlpattern-polyfill";
|
4
|
+
|
5
|
+
import "../docloader-CkweNhUH.js";
|
6
|
+
import { getNodeInfo, nodeInfoToJson, parseNodeInfo } from "../types-dLXLjVLf.js";
|
7
|
+
import "../nodeinfo-DfycQ8Wf.js";
|
8
8
|
|
9
|
-
export {
|
9
|
+
export { getNodeInfo, nodeInfoToJson, parseNodeInfo };
|
@@ -3,14 +3,13 @@
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
globalThis.addEventListener = () => {};
|
5
5
|
|
6
|
-
import "../type-
|
6
|
+
import "../type-NEA09tSC.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 { test } from "../testing-DFgpNAI6.js";
|
10
|
+
import "../lookup-DhQCVVja.js";
|
11
|
+
import { nodeInfoToJson } from "../types-BSuWJsOm.js";
|
12
|
+
import { test } from "../testing-BnfPB5T-.js";
|
14
13
|
import "../std__assert-X-_kMxKM.js";
|
15
14
|
import "../assert_rejects-DiIiJbZn.js";
|
16
15
|
import "../assert_is_error-BPGph1Jx.js";
|
@@ -22,11 +21,7 @@ test("nodeInfoToJson()", () => {
|
|
22
21
|
const validInfo = {
|
23
22
|
software: {
|
24
23
|
name: "software-name",
|
25
|
-
version:
|
26
|
-
major: 1,
|
27
|
-
minor: 2,
|
28
|
-
patch: 3
|
29
|
-
}
|
24
|
+
version: "1.2.3"
|
30
25
|
},
|
31
26
|
protocols: ["activitypub"],
|
32
27
|
usage: {
|