@fedify/fedify 1.7.12 → 1.7.14
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-CPpvuBKU.d.ts → actor-Dx5YX74F.d.ts} +3 -3
- package/dist/{actor-GZRoTRqg.js → actor-OYVgkiZG.js} +329 -465
- package/dist/{actor-TYqJGdVq.js → actor-y7shp0CR.js} +6 -6
- package/dist/{assert-LOEeCUK5.js → assert-C-mZuSQl.js} +2 -2
- package/dist/{assert_equals-B44MxcIj.js → assert_equals-Dy0MG_Zw.js} +16 -16
- package/dist/{assert_instance_of-XtuFevV_.js → assert_instance_of-lS0Jr2iu.js} +2 -2
- package/dist/{assert_is_error-BTlryvT0.js → assert_is_error-CIYFACrT.js} +2 -2
- package/dist/{assert_not_equals-C685gKx6.js → assert_not_equals-C1azCAB0.js} +3 -6
- package/dist/{assert_rejects-DWQ4jaf9.js → assert_rejects-Bkh5lA1a.js} +3 -3
- package/dist/{assert_throws-YetpVSc-.js → assert_throws-CmpfkWEM.js} +3 -3
- package/dist/{authdocloader-hiFSyM7V.js → authdocloader-C0JcfxUs.js} +7 -9
- package/dist/{authdocloader-BopfyipD.js → authdocloader-C2krvRo1.js} +6 -8
- package/dist/{builder-mi6RdzNE.js → builder-DaECqbbT.js} +7 -7
- package/dist/{chunk-Cx8LTkjm.js → chunk-DvTpRkcT.js} +22 -15
- package/dist/{client-DuUKk4pk.js → client-dfu57WLy.js} +3 -3
- package/dist/{client-DvtwXO7t.d.ts → client-wKLuY12i.d.ts} +2 -2
- package/dist/{collection-Dfb0TPno.js → collection-XNLQhehO.js} +2 -3
- package/dist/{mod-DFncUgcE.d.ts → compat/mod-Bwqav33K.d.ts} +3 -3
- package/dist/compat/mod.js +1 -2
- package/dist/compat/transformers.test.js +34 -38
- package/dist/{context-OBWjptjU.d.ts → context-CW_8R4BH.d.ts} +11 -11
- package/dist/{context-RMU32mk4.js → context-nxDPfAiA.js} +5 -5
- package/dist/{docloader-09nVWLAZ.js → docloader-BDSHZfTJ.js} +1 -1
- package/dist/{docloader-DJxET2fN.js → docloader-BU25UQLB.js} +31 -151
- package/dist/{docloader-Q42SMRIB.d.ts → docloader-D_MGP37Q.d.ts} +2 -2
- package/dist/{docloader-bgBm1Hd1.js → docloader-sGz4vcrK.js} +32 -152
- package/dist/{esm-DO9PrujO.js → esm-BRXvTSrx.js} +36 -22
- package/dist/federation/builder.test.js +20 -26
- package/dist/federation/collection.test.js +11 -16
- package/dist/federation/handler.test.js +41 -48
- package/dist/federation/inbox.test.js +11 -11
- package/dist/federation/keycache.test.js +12 -11
- package/dist/federation/kv.test.js +8 -10
- package/dist/federation/middleware.test.js +105 -134
- package/dist/federation/mod-DvlLc8Ru.d.ts +6 -0
- package/dist/federation/mod.js +206 -12
- package/dist/federation/mq.test.js +12 -17
- package/dist/federation/retry.test.js +5 -4
- package/dist/federation/router.test.js +9 -10
- package/dist/federation/send.test.js +23 -24
- package/dist/{http-D2DkwsjA.js → http-BhES0Sg9.js} +23 -30
- package/dist/{http-DMTrO3Ye.d.ts → http-DFZRNfDP.d.ts} +3 -3
- package/dist/{http-vqMAvOVs.js → http-DRePVWfE.js} +23 -30
- package/dist/{inbox-DAAZZl2k.js → inbox-Z_QlSGYN.js} +5 -5
- package/dist/key-CJuc1GE1.js +10 -0
- package/dist/{key-DmqJj57e.js → key-D2HZrCxh.js} +4 -4
- package/dist/{key-KVhaUM92.js → key-bMrDyA2T.js} +5 -5
- package/dist/key-eP5Yk7hl.js +16 -0
- package/dist/{keycache-C1pEuRyQ.js → keycache-B5Rr8Lbc.js} +2 -2
- package/dist/{keys-C4XQHW5_.js → keys-DK4k1R8e.js} +2 -2
- package/dist/{kv-DRaeSXco.d.ts → kv-CKqSUxHd.d.ts} +1 -1
- package/dist/{kv-BMY6Qf_A.js → kv-QeuZ51go.js} +1 -1
- package/dist/{langstr-DbWheeIS.js → langstr-pFHBDU4y.js} +1 -1
- package/dist/{ld-DzlJ_IpT.js → ld--auFISy7.js} +9 -12
- package/dist/{lookup-CSngxuWm.js → lookup-4uc2jh52.js} +3 -3
- package/dist/{lookup-DL62q3Xh.js → lookup-Bq8vhIG4.js} +4 -4
- package/dist/{lookup-Bf-K85bV.d.ts → lookup-CqI9jhXo.d.ts} +2 -2
- package/dist/{lookup-D0je8AqR.js → lookup-cHV4n1IB.js} +6 -6
- package/dist/middleware-72Tuh6Iw.js +17 -0
- package/dist/{middleware-3wVT6S9E.js → middleware-B7p-onxQ.js} +35 -39
- package/dist/middleware-DB3BUysJ.js +32 -0
- package/dist/{middleware-DlDXugwZ.js → middleware-QJjRfjjc.js} +38 -43
- package/dist/{mod-CCL2cvnI.d.ts → mod-BEZy4WHZ.d.ts} +4 -4
- package/dist/mod-DMn4Bxyg.d.ts +20 -0
- package/dist/{mod-CDzlVCUF.d.ts → mod-DjGYGrBd.d.ts} +3 -3
- package/dist/mod.js +17 -17
- package/dist/{mq-DYKDDJmp.d.ts → mq-Cgfbl44M.d.ts} +1 -1
- package/dist/{multibase-CnLHszip.js → multibase-DBcKTV2a.js} +1 -1
- package/dist/nodeinfo/client.test.js +19 -28
- package/dist/nodeinfo/handler.test.js +37 -44
- package/dist/nodeinfo/mod--upgPcaX.d.ts +4 -0
- package/dist/nodeinfo/mod.js +2 -3
- package/dist/nodeinfo/semver.test.js +13 -21
- package/dist/nodeinfo/types.test.js +9 -11
- package/dist/{owner-D0cOz8R5.d.ts → owner-CewLNqWO.d.ts} +4 -4
- package/dist/{owner-81ey_76X.js → owner-DkTRLQAV.js} +4 -4
- package/dist/{proof-DlI7QNdn.js → proof-D4HXHDPz.js} +14 -19
- package/dist/{proof-BlULDH4H.js → proof-DT_xxRPF.js} +11 -13
- package/dist/{retry-BiIhZWgD.js → retry-BQet39_l.js} +1 -1
- package/dist/{router-D_aVZZUc.js → router-BuDkN4RQ.js} +1 -1
- package/dist/runtime/authdocloader.test.js +22 -26
- package/dist/runtime/docloader.test.js +56 -56
- package/dist/runtime/key.test.js +31 -53
- package/dist/runtime/langstr.test.js +8 -10
- package/dist/{mod-qFMzZ3iF.d.ts → runtime/mod-BaH1vtHp.d.ts} +4 -3
- package/dist/runtime/mod.js +6 -7
- package/dist/runtime/multibase/multibase.test.js +12 -18
- package/dist/runtime/url.test.js +7 -6
- package/dist/{semver-BNrOOAs9.js → semver-D9d-VO-_.js} +7 -17
- package/dist/{send-DdxfTHo6.js → send-axIyQX2p.js} +4 -4
- package/dist/sig/http.test.js +104 -168
- package/dist/sig/key.test.js +17 -20
- package/dist/sig/ld.test.js +28 -35
- package/dist/sig/mod-BmJQTnPT.d.ts +6 -0
- package/dist/sig/mod.js +6 -7
- package/dist/sig/owner.test.js +24 -30
- package/dist/sig/proof.test.js +24 -29
- package/dist/{std__assert-o_r9vqm1.js → std__assert-BdP_WkD-.js} +7 -13
- package/dist/testing/docloader.test.js +9 -12
- package/dist/testing/mod.js +2 -1
- package/dist/{testing-DLyvtiiW.js → testing-qaAD4B0t.js} +2 -2
- package/dist/{transformers-ghwJuzGY.js → transformers-CFSWUhNi.js} +1 -1
- package/dist/{type-CFuiGLz9.js → type-DFsmi-p1.js} +1 -1
- package/dist/{types-CmVV9LT1.js → types-Bk4b1bGc.js} +8 -18
- package/dist/{types-CJHS5pXl.js → types-CB_2uuCA.js} +2 -2
- package/dist/{url-C2xuoQD1.js → url-BdNvnK9P.js} +1 -1
- package/dist/vocab/actor.test.js +76 -128
- package/dist/vocab/lookup.test.js +19 -23
- package/dist/vocab/mod-BkXGAYkx.d.ts +6 -0
- package/dist/vocab/mod.js +4 -4
- package/dist/vocab/type.test.js +10 -10
- package/dist/vocab/vocab.test.js +109 -105
- package/dist/{vocab-DFlq4Wa6.js → vocab-DCHRuBGF.js} +328 -464
- package/dist/{vocab-CzEfWQk2.d.ts → vocab-DoBcp8ow.d.ts} +2 -2
- package/dist/{vocab-BebR0kAy.js → vocab-sMuiKIWm.js} +5 -5
- package/dist/webfinger/handler.test.js +40 -48
- package/dist/webfinger/lookup.test.js +12 -15
- package/dist/webfinger/mod-B1UhCvlL.d.ts +4 -0
- package/dist/webfinger/mod.js +2 -3
- package/dist/x/{cfworkers.d.ts → cfworkers-BIcR64Sf.d.ts} +2 -2
- package/dist/x/cfworkers.test.js +7 -9
- package/dist/x/{hono.d.ts → hono-DmQmp8wi.d.ts} +2 -11
- package/dist/x/{sveltekit.d.ts → sveltekit-Cvh0XnN4.d.ts} +2 -11
- package/package.json +1 -1
- package/dist/compat/mod.d.ts +0 -15
- package/dist/compat-Bb5myD13.js +0 -4
- package/dist/federation/mod.d.ts +0 -15
- package/dist/federation-B0aljx0V.js +0 -203
- package/dist/key-5ssHQ67E.js +0 -16
- package/dist/key-DSJGnD10.js +0 -10
- package/dist/middleware-CxFoFBD8.js +0 -33
- package/dist/middleware-w7_U3fFi.js +0 -17
- package/dist/mod-1pDWKvUL.d.ts +0 -2
- package/dist/mod-GIh5OYxW.d.ts +0 -2
- package/dist/mod-g0xFzAP9.d.ts +0 -2
- package/dist/mod.d.ts +0 -20
- package/dist/nodeinfo/mod.d.ts +0 -7
- package/dist/nodeinfo-CyEbLjHs.js +0 -4
- package/dist/runtime/mod.d.ts +0 -8
- package/dist/runtime-BSkOVUWM.js +0 -4
- package/dist/sig/mod.d.ts +0 -10
- package/dist/sig-BXJO--F9.js +0 -4
- package/dist/vocab/mod.d.ts +0 -8
- package/dist/webfinger/mod.d.ts +0 -7
- package/dist/webfinger-C3GIyXIg.js +0 -4
- /package/dist/compat/{transformers.test.d.ts → transformers.test-DnJbd34u.d.ts} +0 -0
- /package/dist/{denokv-CvROlGYX.js → denokv-NcJeZ6rP.js} +0 -0
- /package/dist/federation/{builder.test.d.ts → builder.test-Bpt6NOZ6.d.ts} +0 -0
- /package/dist/federation/{collection.test.d.ts → collection.test-DKJ6JOZz.d.ts} +0 -0
- /package/dist/federation/{handler.test.d.ts → handler.test-BMT7uLC0.d.ts} +0 -0
- /package/dist/federation/{inbox.test.d.ts → inbox.test-Do6i02Qp.d.ts} +0 -0
- /package/dist/federation/{keycache.test.d.ts → keycache.test-BT83IPZY.d.ts} +0 -0
- /package/dist/federation/{kv.test.d.ts → kv.test-kFzzF2VN.d.ts} +0 -0
- /package/dist/federation/{middleware.test.d.ts → middleware.test-B1R4_e3-.d.ts} +0 -0
- /package/dist/federation/{mq.test.d.ts → mq.test-l79EQQOe.d.ts} +0 -0
- /package/dist/federation/{retry.test.d.ts → retry.test-BqS50VCX.d.ts} +0 -0
- /package/dist/federation/{router.test.d.ts → router.test-CYQl4po-.d.ts} +0 -0
- /package/dist/federation/{send.test.d.ts → send.test-COUnNUzv.d.ts} +0 -0
- /package/dist/nodeinfo/{client.test.d.ts → client.test-CZLe79hL.d.ts} +0 -0
- /package/dist/nodeinfo/{handler.test.d.ts → handler.test-B-EDZ_hK.d.ts} +0 -0
- /package/dist/nodeinfo/{semver.test.d.ts → semver.test-BEuuQSEM.d.ts} +0 -0
- /package/dist/nodeinfo/{types.test.d.ts → types.test-B5AT89WV.d.ts} +0 -0
- /package/dist/runtime/{authdocloader.test.d.ts → authdocloader.test-hCRKzn9v.d.ts} +0 -0
- /package/dist/runtime/{docloader.test.d.ts → docloader.test-CVd7i_5h.d.ts} +0 -0
- /package/dist/runtime/{key.test.d.ts → key.test-DBsILYSD.d.ts} +0 -0
- /package/dist/runtime/{langstr.test.d.ts → langstr.test-CiKxuuRY.d.ts} +0 -0
- /package/dist/runtime/multibase/{multibase.test.d.ts → multibase.test-Brh6gPBP.d.ts} +0 -0
- /package/dist/runtime/{url.test.d.ts → url.test-DlRqkU2j.d.ts} +0 -0
- /package/dist/sig/{http.test.d.ts → http.test-BpXNAWNI.d.ts} +0 -0
- /package/dist/sig/{key.test.d.ts → key.test-B2iLIugy.d.ts} +0 -0
- /package/dist/sig/{ld.test.d.ts → ld.test-D-cI70Gw.d.ts} +0 -0
- /package/dist/sig/{owner.test.d.ts → owner.test-B_YRjMPj.d.ts} +0 -0
- /package/dist/sig/{proof.test.d.ts → proof.test-BagEM_-4.d.ts} +0 -0
- /package/dist/testing/{docloader.test.d.ts → docloader.test-lrzf6sDZ.d.ts} +0 -0
- /package/dist/testing/{mod.d.ts → mod-3uM8ZvS7.d.ts} +0 -0
- /package/dist/vocab/{actor.test.d.ts → actor.test-ClC-iVWk.d.ts} +0 -0
- /package/dist/vocab/{lookup.test.d.ts → lookup.test-Cq1I-27w.d.ts} +0 -0
- /package/dist/vocab/{type.test.d.ts → type.test-bfFiYGcs.d.ts} +0 -0
- /package/dist/vocab/{vocab.test.d.ts → vocab.test-h-ZTisfu.d.ts} +0 -0
- /package/dist/webfinger/{handler.test.d.ts → handler.test-DiUeEDDD.d.ts} +0 -0
- /package/dist/webfinger/{lookup.test.d.ts → lookup.test-D9onm3U3.d.ts} +0 -0
- /package/dist/x/{cfworkers.test.d.ts → cfworkers.test-KXHlJ29z.d.ts} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
-
import { DocumentLoader } from "./docloader-
|
|
3
|
+
import { n as DocumentLoader } from "./docloader-D_MGP37Q.js";
|
|
4
4
|
import { Span, TracerProvider } from "@opentelemetry/api";
|
|
5
5
|
import { LanguageTag } from "@phensley/language-tag";
|
|
6
6
|
|
|
@@ -14452,4 +14452,4 @@ declare class View extends Activity {
|
|
|
14452
14452
|
protected _getCustomInspectProxy(): Record<string, unknown>;
|
|
14453
14453
|
}
|
|
14454
14454
|
//#endregion
|
|
14455
|
-
export {
|
|
14455
|
+
export { Read as $, Image as A, Multikey as B, Event as C, Group as D, Follow as E, Like as F, OrderedCollectionPage as G, Object$1 as H, Link as I, Person as J, Organization as K, Listen as L, Invite as M, Join as N, Hashtag as O, Leave as P, Question as Q, Mention as R, Endpoints as S, Flag as T, Offer as U, Note as V, OrderedCollection as W, Profile as X, Place as Y, PropertyValue as Z, DidService as _, Application as a, TentativeAccept as at, Emoji as b, Audio as c, Travel as ct, Collection as d, Video as dt, Reject as et, CollectionPage as f, View as ft, Delete as g, DataIntegrityProof as h, Announce as i, Source as it, IntransitiveActivity as j, Ignore as k, Block as l, Undo as lt, CryptographicKey as m, Activity as n, Remove as nt, Arrive as o, TentativeReject as ot, Create as p, LanguageString as pt, Page as q, Add as r, Service as rt, Article as s, Tombstone as st, Accept as t, Relationship as tt, ChatMessage as u, Update as ut, Dislike as v, Export as w, EmojiReact as x, Document as y, Move as z };
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
import { Temporal } from "@js-temporal/polyfill";
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { lookupWebFinger } from "./lookup-
|
|
5
|
+
import { d as name, f as version, i as getDocumentLoader } from "./docloader-BU25UQLB.js";
|
|
6
|
+
import { Tt as getTypeId, q as Object$1 } from "./actor-OYVgkiZG.js";
|
|
7
|
+
import { t as lookupWebFinger } from "./lookup-4uc2jh52.js";
|
|
8
8
|
import { getLogger } from "@logtape/logtape";
|
|
9
9
|
import { SpanStatusCode, trace } from "@opentelemetry/api";
|
|
10
10
|
import { delay } from "@es-toolkit/es-toolkit";
|
|
@@ -49,7 +49,7 @@ const handleRegexp = /^@?((?:[-A-Za-z0-9._~!$&'()*+,;=]|%[A-Fa-f0-9]{2})+)@([^@]
|
|
|
49
49
|
* @since 0.2.0
|
|
50
50
|
*/
|
|
51
51
|
async function lookupObject(identifier, options = {}) {
|
|
52
|
-
return await (options.tracerProvider ?? trace.getTracerProvider()).getTracer(
|
|
52
|
+
return await (options.tracerProvider ?? trace.getTracerProvider()).getTracer(name, version).startActiveSpan("activitypub.lookup_object", async (span) => {
|
|
53
53
|
try {
|
|
54
54
|
const result = await lookupObjectInternal(identifier, options);
|
|
55
55
|
if (result == null) span.setStatus({ code: SpanStatusCode.ERROR });
|
|
@@ -165,4 +165,4 @@ async function* traverseCollection(collection, options = {}) {
|
|
|
165
165
|
const PUBLIC_COLLECTION = new URL("https://www.w3.org/ns/activitystreams#Public");
|
|
166
166
|
|
|
167
167
|
//#endregion
|
|
168
|
-
export {
|
|
168
|
+
export { lookupObject as n, traverseCollection as r, PUBLIC_COLLECTION as t };
|
|
@@ -3,52 +3,47 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import
|
|
7
|
-
import "../
|
|
8
|
-
import "../
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
11
|
-
import "../
|
|
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 "../
|
|
28
|
-
import "../
|
|
29
|
-
import "../
|
|
30
|
-
import "../
|
|
31
|
-
import "../
|
|
32
|
-
import "../
|
|
33
|
-
import "../
|
|
34
|
-
import "../
|
|
35
|
-
import "../
|
|
36
|
-
import
|
|
37
|
-
import "../
|
|
38
|
-
import "../
|
|
39
|
-
import "../
|
|
40
|
-
import "../assert_not_equals-C685gKx6.js";
|
|
41
|
-
import "../assert_throws-YetpVSc-.js";
|
|
42
|
-
import "../docloader-09nVWLAZ.js";
|
|
43
|
-
import { createRequestContext } from "../context-RMU32mk4.js";
|
|
6
|
+
import "../chunk-DvTpRkcT.js";
|
|
7
|
+
import { t as assertEquals } from "../assert_equals-Dy0MG_Zw.js";
|
|
8
|
+
import { t as MemoryKvStore } from "../kv-QeuZ51go.js";
|
|
9
|
+
import { a as createFederation, p as handleWebFinger } from "../middleware-B7p-onxQ.js";
|
|
10
|
+
import "../docloader-sGz4vcrK.js";
|
|
11
|
+
import "../url-BdNvnK9P.js";
|
|
12
|
+
import "../semver-D9d-VO-_.js";
|
|
13
|
+
import "../client-dfu57WLy.js";
|
|
14
|
+
import "../router-BuDkN4RQ.js";
|
|
15
|
+
import "../types-CB_2uuCA.js";
|
|
16
|
+
import "../multibase-DBcKTV2a.js";
|
|
17
|
+
import { S as Person, f as Image, m as Link } from "../vocab-DCHRuBGF.js";
|
|
18
|
+
import "../langstr-pFHBDU4y.js";
|
|
19
|
+
import "../lookup-Bq8vhIG4.js";
|
|
20
|
+
import "../actor-y7shp0CR.js";
|
|
21
|
+
import "../key-bMrDyA2T.js";
|
|
22
|
+
import "../http-BhES0Sg9.js";
|
|
23
|
+
import "../authdocloader-C0JcfxUs.js";
|
|
24
|
+
import "../ld--auFISy7.js";
|
|
25
|
+
import "../owner-DkTRLQAV.js";
|
|
26
|
+
import "../proof-DT_xxRPF.js";
|
|
27
|
+
import "../lookup-cHV4n1IB.js";
|
|
28
|
+
import "../inbox-Z_QlSGYN.js";
|
|
29
|
+
import "../builder-DaECqbbT.js";
|
|
30
|
+
import "../collection-XNLQhehO.js";
|
|
31
|
+
import "../keycache-B5Rr8Lbc.js";
|
|
32
|
+
import "../send-axIyQX2p.js";
|
|
33
|
+
import { t as test } from "../testing-qaAD4B0t.js";
|
|
34
|
+
import "../std__assert-BdP_WkD-.js";
|
|
35
|
+
import "../assert_rejects-Bkh5lA1a.js";
|
|
36
|
+
import "../assert_is_error-CIYFACrT.js";
|
|
37
|
+
import "../assert_throws-CmpfkWEM.js";
|
|
38
|
+
import "../docloader-BDSHZfTJ.js";
|
|
39
|
+
import { n as createRequestContext } from "../context-nxDPfAiA.js";
|
|
44
40
|
|
|
45
41
|
//#region webfinger/handler.test.ts
|
|
46
42
|
test("handleWebFinger()", async (t) => {
|
|
47
43
|
const url = new URL("https://example.com/.well-known/webfinger");
|
|
48
44
|
function createContext(url$1) {
|
|
49
|
-
const federation = createFederation({ kv: new MemoryKvStore() });
|
|
50
45
|
const context = createRequestContext({
|
|
51
|
-
federation,
|
|
46
|
+
federation: createFederation({ kv: new MemoryKvStore() }),
|
|
52
47
|
url: url$1,
|
|
53
48
|
data: void 0,
|
|
54
49
|
getActorUri(identifier) {
|
|
@@ -99,11 +94,10 @@ test("handleWebFinger()", async (t) => {
|
|
|
99
94
|
await t.step("no actor dispatcher", async () => {
|
|
100
95
|
const context = createContext(url);
|
|
101
96
|
const request = context.request;
|
|
102
|
-
|
|
97
|
+
assertEquals((await handleWebFinger(request, {
|
|
103
98
|
context,
|
|
104
99
|
onNotFound
|
|
105
|
-
});
|
|
106
|
-
assertEquals(response.status, 404);
|
|
100
|
+
})).status, 404);
|
|
107
101
|
assertEquals(onNotFoundCalled, request);
|
|
108
102
|
});
|
|
109
103
|
onNotFoundCalled = null;
|
|
@@ -123,8 +117,7 @@ test("handleWebFinger()", async (t) => {
|
|
|
123
117
|
const u = new URL(url);
|
|
124
118
|
u.searchParams.set("resource", " invalid ");
|
|
125
119
|
const context = createContext(u);
|
|
126
|
-
const
|
|
127
|
-
const response = await handleWebFinger(request, {
|
|
120
|
+
const response = await handleWebFinger(new Request(u), {
|
|
128
121
|
context,
|
|
129
122
|
actorDispatcher,
|
|
130
123
|
onNotFound
|
|
@@ -230,12 +223,11 @@ test("handleWebFinger()", async (t) => {
|
|
|
230
223
|
u.searchParams.set("resource", "acct:no-one@example.com");
|
|
231
224
|
const context = createContext(u);
|
|
232
225
|
const request = context.request;
|
|
233
|
-
|
|
226
|
+
assertEquals((await handleWebFinger(request, {
|
|
234
227
|
context,
|
|
235
228
|
actorDispatcher,
|
|
236
229
|
onNotFound
|
|
237
|
-
});
|
|
238
|
-
assertEquals(response.status, 404);
|
|
230
|
+
})).status, 404);
|
|
239
231
|
assertEquals(onNotFoundCalled, request);
|
|
240
232
|
});
|
|
241
233
|
onNotFoundCalled = null;
|
|
@@ -3,19 +3,17 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import
|
|
7
|
-
import "../
|
|
8
|
-
import "../
|
|
9
|
-
import "../
|
|
10
|
-
import "../
|
|
11
|
-
import {
|
|
12
|
-
import
|
|
13
|
-
import "../
|
|
14
|
-
import "../
|
|
15
|
-
import "../
|
|
16
|
-
import "../
|
|
17
|
-
import "../assert_throws-YetpVSc-.js";
|
|
18
|
-
import { esm_default } from "../esm-DO9PrujO.js";
|
|
6
|
+
import "../chunk-DvTpRkcT.js";
|
|
7
|
+
import { t as assertEquals } from "../assert_equals-Dy0MG_Zw.js";
|
|
8
|
+
import "../docloader-sGz4vcrK.js";
|
|
9
|
+
import "../url-BdNvnK9P.js";
|
|
10
|
+
import { t as lookupWebFinger } from "../lookup-Bq8vhIG4.js";
|
|
11
|
+
import { t as test } from "../testing-qaAD4B0t.js";
|
|
12
|
+
import "../std__assert-BdP_WkD-.js";
|
|
13
|
+
import "../assert_rejects-Bkh5lA1a.js";
|
|
14
|
+
import "../assert_is_error-CIYFACrT.js";
|
|
15
|
+
import "../assert_throws-CmpfkWEM.js";
|
|
16
|
+
import { t as esm_default } from "../esm-BRXvTSrx.js";
|
|
19
17
|
import { withTimeout } from "@es-toolkit/es-toolkit";
|
|
20
18
|
|
|
21
19
|
//#region webfinger/lookup.test.ts
|
|
@@ -98,8 +96,7 @@ test({
|
|
|
98
96
|
headers: { Location: "/.well-known/webfinger" }
|
|
99
97
|
});
|
|
100
98
|
await t.step("infinite redirection", async () => {
|
|
101
|
-
|
|
102
|
-
assertEquals(result, null);
|
|
99
|
+
assertEquals(await withTimeout(() => lookupWebFinger("acct:johndoe@example.com"), 2e3), null);
|
|
103
100
|
});
|
|
104
101
|
esm_default.removeRoutes();
|
|
105
102
|
esm_default.get("begin:https://example.com/.well-known/webfinger?", {
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Temporal } from "@js-temporal/polyfill";
|
|
2
|
+
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
+
import { i as ResourceDescriptor, n as lookupWebFinger, r as Link, t as LookupWebFingerOptions } from "../lookup-CqI9jhXo.js";
|
|
4
|
+
export { Link, LookupWebFingerOptions, ResourceDescriptor, lookupWebFinger };
|
package/dist/webfinger/mod.js
CHANGED
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
import { Temporal } from "@js-temporal/polyfill";
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
|
|
5
|
-
import "../docloader-
|
|
6
|
-
import { lookupWebFinger } from "../lookup-
|
|
7
|
-
import "../webfinger-C3GIyXIg.js";
|
|
5
|
+
import "../docloader-BU25UQLB.js";
|
|
6
|
+
import { t as lookupWebFinger } from "../lookup-4uc2jh52.js";
|
|
8
7
|
|
|
9
8
|
export { lookupWebFinger };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { n as KvStore, r as KvStoreSetOptions, t as KvKey } from "../kv-CKqSUxHd.js";
|
|
4
|
+
import { a as MessageQueueListenOptions, i as MessageQueueEnqueueOptions, r as MessageQueue } from "../mq-Cgfbl44M.js";
|
|
5
5
|
import { KVNamespace, Queue } from "@cloudflare/workers-types/experimental";
|
|
6
6
|
|
|
7
7
|
//#region x/cfworkers.d.ts
|
package/dist/x/cfworkers.test.js
CHANGED
|
@@ -3,15 +3,13 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import
|
|
7
|
-
import "../
|
|
8
|
-
import "../
|
|
9
|
-
import
|
|
10
|
-
import "../
|
|
11
|
-
import "../
|
|
12
|
-
import "../
|
|
13
|
-
import "../assert_not_equals-C685gKx6.js";
|
|
14
|
-
import "../assert_throws-YetpVSc-.js";
|
|
6
|
+
import "../chunk-DvTpRkcT.js";
|
|
7
|
+
import { t as assertEquals } from "../assert_equals-Dy0MG_Zw.js";
|
|
8
|
+
import { t as test } from "../testing-qaAD4B0t.js";
|
|
9
|
+
import "../std__assert-BdP_WkD-.js";
|
|
10
|
+
import "../assert_rejects-Bkh5lA1a.js";
|
|
11
|
+
import "../assert_is_error-CIYFACrT.js";
|
|
12
|
+
import "../assert_throws-CmpfkWEM.js";
|
|
15
13
|
import { delay } from "@es-toolkit/es-toolkit";
|
|
16
14
|
|
|
17
15
|
//#region x/cfworkers.ts
|
|
@@ -1,18 +1,9 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
-
import "../
|
|
4
|
-
import "../docloader-Q42SMRIB.js";
|
|
5
|
-
import "../client-DvtwXO7t.js";
|
|
6
|
-
import "../vocab-CzEfWQk2.js";
|
|
7
|
-
import "../actor-CPpvuBKU.js";
|
|
8
|
-
import "../http-DMTrO3Ye.js";
|
|
9
|
-
import "../owner-D0cOz8R5.js";
|
|
10
|
-
import "../mod-CDzlVCUF.js";
|
|
11
|
-
import "../lookup-Bf-K85bV.js";
|
|
12
|
-
import { Federation } from "../context-OBWjptjU.js";
|
|
13
|
-
import "../mq-DYKDDJmp.js";
|
|
3
|
+
import { m as Federation } from "../context-CW_8R4BH.js";
|
|
14
4
|
|
|
15
5
|
//#region x/hono.d.ts
|
|
6
|
+
|
|
16
7
|
interface HonoRequest {
|
|
17
8
|
raw: Request;
|
|
18
9
|
}
|
|
@@ -1,18 +1,9 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
-
import "../
|
|
4
|
-
import "../docloader-Q42SMRIB.js";
|
|
5
|
-
import "../client-DvtwXO7t.js";
|
|
6
|
-
import "../vocab-CzEfWQk2.js";
|
|
7
|
-
import "../actor-CPpvuBKU.js";
|
|
8
|
-
import "../http-DMTrO3Ye.js";
|
|
9
|
-
import "../owner-D0cOz8R5.js";
|
|
10
|
-
import "../mod-CDzlVCUF.js";
|
|
11
|
-
import "../lookup-Bf-K85bV.js";
|
|
12
|
-
import { Federation } from "../context-OBWjptjU.js";
|
|
13
|
-
import "../mq-DYKDDJmp.js";
|
|
3
|
+
import { m as Federation } from "../context-CW_8R4BH.js";
|
|
14
4
|
|
|
15
5
|
//#region x/sveltekit.d.ts
|
|
6
|
+
|
|
16
7
|
type RequestEvent = {
|
|
17
8
|
request: Request;
|
|
18
9
|
};
|
package/package.json
CHANGED
package/dist/compat/mod.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { Temporal } from "@js-temporal/polyfill";
|
|
2
|
-
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
-
import "../kv-DRaeSXco.js";
|
|
4
|
-
import "../docloader-Q42SMRIB.js";
|
|
5
|
-
import "../client-DvtwXO7t.js";
|
|
6
|
-
import "../vocab-CzEfWQk2.js";
|
|
7
|
-
import "../actor-CPpvuBKU.js";
|
|
8
|
-
import "../http-DMTrO3Ye.js";
|
|
9
|
-
import "../owner-D0cOz8R5.js";
|
|
10
|
-
import "../mod-CDzlVCUF.js";
|
|
11
|
-
import "../lookup-Bf-K85bV.js";
|
|
12
|
-
import { ActivityTransformer } from "../context-OBWjptjU.js";
|
|
13
|
-
import "../mq-DYKDDJmp.js";
|
|
14
|
-
import { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers } from "../mod-DFncUgcE.js";
|
|
15
|
-
export { ActivityTransformer, actorDehydrator, autoIdAssigner, getDefaultActivityTransformers };
|
package/dist/compat-Bb5myD13.js
DELETED
package/dist/federation/mod.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { Temporal } from "@js-temporal/polyfill";
|
|
2
|
-
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
-
import { KvKey, KvStore, KvStoreSetOptions, MemoryKvStore } from "../kv-DRaeSXco.js";
|
|
4
|
-
import "../docloader-Q42SMRIB.js";
|
|
5
|
-
import "../client-DvtwXO7t.js";
|
|
6
|
-
import "../vocab-CzEfWQk2.js";
|
|
7
|
-
import "../actor-CPpvuBKU.js";
|
|
8
|
-
import "../http-DMTrO3Ye.js";
|
|
9
|
-
import "../owner-D0cOz8R5.js";
|
|
10
|
-
import "../mod-CDzlVCUF.js";
|
|
11
|
-
import "../lookup-Bf-K85bV.js";
|
|
12
|
-
import { ActorAliasMapper, ActorCallbackSetters, ActorDispatcher, ActorHandleMapper, ActorKeyPair, ActorKeyPairsDispatcher, AuthorizePredicate, CollectionCallbackSetters, CollectionCounter, CollectionCursor, CollectionDispatcher, Context, CreateExponentialBackoffPolicyOptions, CreateFederationOptions, Federatable, Federation, FederationBuilder, FederationFetchOptions, FederationKvPrefixes, FederationOptions, FederationOrigin, FederationQueueOptions, FederationStartQueueOptions, ForwardActivityOptions, GetSignedKeyOptions, InboxContext, InboxErrorHandler, InboxListener, InboxListenerSetters, Message, NodeInfoDispatcher, ObjectAuthorizePredicate, ObjectCallbackSetters, ObjectDispatcher, OutboxErrorHandler, PageItems, ParseUriResult, RequestContext, RespondWithObjectOptions, RetryContext, RetryPolicy, RouteActivityOptions, Router, RouterError, RouterOptions, RouterRouteResult, SendActivityOptions, SendActivityOptionsForCollection, SenderKeyPair, SharedInboxKeyDispatcher, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, digest, respondWithObject, respondWithObjectIfAcceptable } from "../context-OBWjptjU.js";
|
|
13
|
-
import { InProcessMessageQueue, InProcessMessageQueueOptions, MessageQueue, MessageQueueEnqueueOptions, MessageQueueListenOptions, ParallelMessageQueue } from "../mq-DYKDDJmp.js";
|
|
14
|
-
import "../mod-g0xFzAP9.js";
|
|
15
|
-
export { ActorAliasMapper, ActorCallbackSetters, ActorDispatcher, ActorHandleMapper, ActorKeyPair, ActorKeyPairsDispatcher, AuthorizePredicate, CollectionCallbackSetters, CollectionCounter, CollectionCursor, CollectionDispatcher, Context, CreateExponentialBackoffPolicyOptions, CreateFederationOptions, Federatable, Federation, FederationBuilder, FederationFetchOptions, FederationKvPrefixes, FederationOptions, FederationOrigin, FederationQueueOptions, FederationStartQueueOptions, ForwardActivityOptions, GetSignedKeyOptions, InProcessMessageQueue, InProcessMessageQueueOptions, InboxContext, InboxErrorHandler, InboxListener, InboxListenerSetters, KvKey, KvStore, KvStoreSetOptions, MemoryKvStore, Message, MessageQueue, MessageQueueEnqueueOptions, MessageQueueListenOptions, NodeInfoDispatcher, ObjectAuthorizePredicate, ObjectCallbackSetters, ObjectDispatcher, OutboxErrorHandler, PageItems, ParallelMessageQueue, ParseUriResult, RequestContext, RespondWithObjectOptions, RetryContext, RetryPolicy, RouteActivityOptions, Router, RouterError, RouterOptions, RouterRouteResult, SendActivityOptions, SendActivityOptionsForCollection, SenderKeyPair, SharedInboxKeyDispatcher, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, digest, respondWithObject, respondWithObjectIfAcceptable };
|
|
@@ -1,203 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { Temporal } from "@js-temporal/polyfill";
|
|
3
|
-
import { URLPattern } from "urlpattern-polyfill";
|
|
4
|
-
|
|
5
|
-
//#region federation/kv.ts
|
|
6
|
-
/**
|
|
7
|
-
* A key–value store that stores values in memory.
|
|
8
|
-
* Do not use this in production as it does not persist values.
|
|
9
|
-
*
|
|
10
|
-
* @since 0.5.0
|
|
11
|
-
*/
|
|
12
|
-
var MemoryKvStore = class {
|
|
13
|
-
#values = {};
|
|
14
|
-
#encodeKey(key) {
|
|
15
|
-
return JSON.stringify(key);
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* {@inheritDoc KvStore.get}
|
|
19
|
-
*/
|
|
20
|
-
get(key) {
|
|
21
|
-
const encodedKey = this.#encodeKey(key);
|
|
22
|
-
const entry = this.#values[encodedKey];
|
|
23
|
-
if (entry == null) return Promise.resolve(void 0);
|
|
24
|
-
const [value, expiration] = entry;
|
|
25
|
-
if (expiration != null && Temporal.Now.instant().until(expiration).sign < 0) {
|
|
26
|
-
delete this.#values[encodedKey];
|
|
27
|
-
return Promise.resolve(void 0);
|
|
28
|
-
}
|
|
29
|
-
return Promise.resolve(value);
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* {@inheritDoc KvStore.set}
|
|
33
|
-
*/
|
|
34
|
-
set(key, value, options) {
|
|
35
|
-
const encodedKey = this.#encodeKey(key);
|
|
36
|
-
const expiration = options?.ttl == null ? null : Temporal.Now.instant().add(options.ttl.round({ largestUnit: "hour" }));
|
|
37
|
-
this.#values[encodedKey] = [value, expiration];
|
|
38
|
-
return Promise.resolve();
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* {@inheritDoc KvStore.delete}
|
|
42
|
-
*/
|
|
43
|
-
delete(key) {
|
|
44
|
-
const encodedKey = this.#encodeKey(key);
|
|
45
|
-
delete this.#values[encodedKey];
|
|
46
|
-
return Promise.resolve();
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
//#endregion
|
|
51
|
-
//#region federation/mq.ts
|
|
52
|
-
/**
|
|
53
|
-
* A message queue that processes messages in the same process.
|
|
54
|
-
* Do not use this in production as it does neither persist messages nor
|
|
55
|
-
* distribute them across multiple processes.
|
|
56
|
-
*
|
|
57
|
-
* @since 0.5.0
|
|
58
|
-
*/
|
|
59
|
-
var InProcessMessageQueue = class {
|
|
60
|
-
#messages;
|
|
61
|
-
#monitors;
|
|
62
|
-
#pollIntervalMs;
|
|
63
|
-
/**
|
|
64
|
-
* In-process message queue does not provide native retry mechanisms.
|
|
65
|
-
* @since 1.7.0
|
|
66
|
-
*/
|
|
67
|
-
nativeRetrial = false;
|
|
68
|
-
/**
|
|
69
|
-
* Constructs a new {@link InProcessMessageQueue} with the given options.
|
|
70
|
-
* @param options Additional options for the in-process message queue.
|
|
71
|
-
*/
|
|
72
|
-
constructor(options = {}) {
|
|
73
|
-
this.#messages = [];
|
|
74
|
-
this.#monitors = {};
|
|
75
|
-
this.#pollIntervalMs = Temporal.Duration.from(options.pollInterval ?? { seconds: 5 }).total("millisecond");
|
|
76
|
-
}
|
|
77
|
-
enqueue(message, options) {
|
|
78
|
-
const delay = options?.delay == null ? 0 : Math.max(options.delay.total("millisecond"), 0);
|
|
79
|
-
if (delay > 0) {
|
|
80
|
-
setTimeout(() => this.enqueue(message, {
|
|
81
|
-
...options,
|
|
82
|
-
delay: void 0
|
|
83
|
-
}), delay);
|
|
84
|
-
return Promise.resolve();
|
|
85
|
-
}
|
|
86
|
-
this.#messages.push(message);
|
|
87
|
-
for (const monitorId in this.#monitors) this.#monitors[monitorId]();
|
|
88
|
-
return Promise.resolve();
|
|
89
|
-
}
|
|
90
|
-
enqueueMany(messages, options) {
|
|
91
|
-
if (messages.length === 0) return Promise.resolve();
|
|
92
|
-
const delay = options?.delay == null ? 0 : Math.max(options.delay.total("millisecond"), 0);
|
|
93
|
-
if (delay > 0) {
|
|
94
|
-
setTimeout(() => this.enqueueMany(messages, {
|
|
95
|
-
...options,
|
|
96
|
-
delay: void 0
|
|
97
|
-
}), delay);
|
|
98
|
-
return Promise.resolve();
|
|
99
|
-
}
|
|
100
|
-
this.#messages.push(...messages);
|
|
101
|
-
for (const monitorId in this.#monitors) this.#monitors[monitorId]();
|
|
102
|
-
return Promise.resolve();
|
|
103
|
-
}
|
|
104
|
-
async listen(handler, options = {}) {
|
|
105
|
-
const signal = options.signal;
|
|
106
|
-
while (signal == null || !signal.aborted) {
|
|
107
|
-
while (this.#messages.length > 0) {
|
|
108
|
-
const message = this.#messages.shift();
|
|
109
|
-
await handler(message);
|
|
110
|
-
}
|
|
111
|
-
await this.#wait(this.#pollIntervalMs, signal);
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
#wait(ms, signal) {
|
|
115
|
-
let timer = null;
|
|
116
|
-
return Promise.any([new Promise((resolve) => {
|
|
117
|
-
signal?.addEventListener("abort", () => {
|
|
118
|
-
if (timer != null) clearTimeout(timer);
|
|
119
|
-
resolve();
|
|
120
|
-
}, { once: true });
|
|
121
|
-
const monitorId = crypto.randomUUID();
|
|
122
|
-
this.#monitors[monitorId] = () => {
|
|
123
|
-
delete this.#monitors[monitorId];
|
|
124
|
-
if (timer != null) clearTimeout(timer);
|
|
125
|
-
resolve();
|
|
126
|
-
};
|
|
127
|
-
}), new Promise((resolve) => timer = setTimeout(resolve, ms))]);
|
|
128
|
-
}
|
|
129
|
-
};
|
|
130
|
-
/**
|
|
131
|
-
* A message queue that processes messages in parallel. It takes another
|
|
132
|
-
* {@link MessageQueue}, and processes messages in parallel up to a certain
|
|
133
|
-
* number of workers.
|
|
134
|
-
*
|
|
135
|
-
* Actually, it's rather a decorator than a queue itself.
|
|
136
|
-
*
|
|
137
|
-
* Note that the workers do not run in truly parallel, in the sense that they
|
|
138
|
-
* are not running in separate threads or processes. They are running in the
|
|
139
|
-
* same process, but are scheduled to run in parallel. Hence, this is useful
|
|
140
|
-
* for I/O-bound tasks, but not for CPU-bound tasks, which is okay for Fedify's
|
|
141
|
-
* workloads.
|
|
142
|
-
*
|
|
143
|
-
* @since 1.0.0
|
|
144
|
-
*/
|
|
145
|
-
var ParallelMessageQueue = class ParallelMessageQueue {
|
|
146
|
-
queue;
|
|
147
|
-
workers;
|
|
148
|
-
/**
|
|
149
|
-
* Inherits the native retry capability from the wrapped queue.
|
|
150
|
-
* @since 1.7.0
|
|
151
|
-
*/
|
|
152
|
-
nativeRetrial;
|
|
153
|
-
/**
|
|
154
|
-
* Constructs a new {@link ParallelMessageQueue} with the given queue and
|
|
155
|
-
* number of workers.
|
|
156
|
-
* @param queue The message queue to use under the hood. Note that
|
|
157
|
-
* {@link ParallelMessageQueue} cannot be nested.
|
|
158
|
-
* @param workers The number of workers to process messages in parallel.
|
|
159
|
-
* @throws {TypeError} If the given queue is an instance of
|
|
160
|
-
* {@link ParallelMessageQueue}.
|
|
161
|
-
*/
|
|
162
|
-
constructor(queue, workers) {
|
|
163
|
-
if (queue instanceof ParallelMessageQueue) throw new TypeError("Cannot nest ParallelMessageQueue.");
|
|
164
|
-
this.queue = queue;
|
|
165
|
-
this.workers = workers;
|
|
166
|
-
this.nativeRetrial = queue.nativeRetrial;
|
|
167
|
-
}
|
|
168
|
-
enqueue(message, options) {
|
|
169
|
-
return this.queue.enqueue(message, options);
|
|
170
|
-
}
|
|
171
|
-
async enqueueMany(messages, options) {
|
|
172
|
-
if (this.queue.enqueueMany == null) {
|
|
173
|
-
const errors = (await Promise.allSettled(messages.map((message) => this.queue.enqueue(message, options)))).filter((r) => r.status === "rejected").map((r) => r.reason);
|
|
174
|
-
if (errors.length > 1) throw new AggregateError(errors, "Failed to enqueue messages.");
|
|
175
|
-
else if (errors.length === 1) throw errors[0];
|
|
176
|
-
return;
|
|
177
|
-
}
|
|
178
|
-
await this.queue.enqueueMany(messages, options);
|
|
179
|
-
}
|
|
180
|
-
listen(handler, options = {}) {
|
|
181
|
-
const workers = /* @__PURE__ */ new Map();
|
|
182
|
-
return this.queue.listen(async (message) => {
|
|
183
|
-
while (workers.size >= this.workers) {
|
|
184
|
-
const consumedId = await Promise.any(workers.values());
|
|
185
|
-
workers.delete(consumedId);
|
|
186
|
-
}
|
|
187
|
-
const workerId = crypto.randomUUID();
|
|
188
|
-
const promise = this.#work(workerId, handler, message);
|
|
189
|
-
workers.set(workerId, promise);
|
|
190
|
-
}, options);
|
|
191
|
-
}
|
|
192
|
-
async #work(workerId, handler, message) {
|
|
193
|
-
await this.#sleep(0);
|
|
194
|
-
await handler(message);
|
|
195
|
-
return workerId;
|
|
196
|
-
}
|
|
197
|
-
#sleep(ms) {
|
|
198
|
-
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
199
|
-
}
|
|
200
|
-
};
|
|
201
|
-
|
|
202
|
-
//#endregion
|
|
203
|
-
export { InProcessMessageQueue, MemoryKvStore, ParallelMessageQueue };
|
package/dist/key-5ssHQ67E.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { Temporal } from "@js-temporal/polyfill";
|
|
3
|
-
import { URLPattern } from "urlpattern-polyfill";
|
|
4
|
-
globalThis.addEventListener = () => {};
|
|
5
|
-
|
|
6
|
-
import "./docloader-bgBm1Hd1.js";
|
|
7
|
-
import "./url-C2xuoQD1.js";
|
|
8
|
-
import "./multibase-CnLHszip.js";
|
|
9
|
-
import "./vocab-DFlq4Wa6.js";
|
|
10
|
-
import "./langstr-DbWheeIS.js";
|
|
11
|
-
import "./lookup-DL62q3Xh.js";
|
|
12
|
-
import "./type-CFuiGLz9.js";
|
|
13
|
-
import "./actor-TYqJGdVq.js";
|
|
14
|
-
import { exportJwk, fetchKey, generateCryptoKeyPair, importJwk, validateCryptoKey } from "./key-KVhaUM92.js";
|
|
15
|
-
|
|
16
|
-
export { validateCryptoKey };
|
package/dist/key-DSJGnD10.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { Temporal } from "@js-temporal/polyfill";
|
|
3
|
-
import { URLPattern } from "urlpattern-polyfill";
|
|
4
|
-
|
|
5
|
-
import "./docloader-DJxET2fN.js";
|
|
6
|
-
import "./actor-GZRoTRqg.js";
|
|
7
|
-
import "./lookup-CSngxuWm.js";
|
|
8
|
-
import { exportJwk, fetchKey, generateCryptoKeyPair, importJwk, validateCryptoKey } from "./key-DmqJj57e.js";
|
|
9
|
-
|
|
10
|
-
export { validateCryptoKey };
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { Temporal } from "@js-temporal/polyfill";
|
|
3
|
-
import { URLPattern } from "urlpattern-polyfill";
|
|
4
|
-
globalThis.addEventListener = () => {};
|
|
5
|
-
|
|
6
|
-
import { ContextImpl, FederationImpl, InboxContextImpl, KvSpecDeterminer, createFederation } from "./middleware-3wVT6S9E.js";
|
|
7
|
-
import "./docloader-bgBm1Hd1.js";
|
|
8
|
-
import "./url-C2xuoQD1.js";
|
|
9
|
-
import "./semver-BNrOOAs9.js";
|
|
10
|
-
import "./client-DuUKk4pk.js";
|
|
11
|
-
import "./router-D_aVZZUc.js";
|
|
12
|
-
import "./types-CJHS5pXl.js";
|
|
13
|
-
import "./multibase-CnLHszip.js";
|
|
14
|
-
import "./vocab-DFlq4Wa6.js";
|
|
15
|
-
import "./langstr-DbWheeIS.js";
|
|
16
|
-
import "./lookup-DL62q3Xh.js";
|
|
17
|
-
import "./type-CFuiGLz9.js";
|
|
18
|
-
import "./actor-TYqJGdVq.js";
|
|
19
|
-
import "./key-KVhaUM92.js";
|
|
20
|
-
import "./http-D2DkwsjA.js";
|
|
21
|
-
import "./authdocloader-hiFSyM7V.js";
|
|
22
|
-
import "./ld-DzlJ_IpT.js";
|
|
23
|
-
import "./owner-81ey_76X.js";
|
|
24
|
-
import "./proof-BlULDH4H.js";
|
|
25
|
-
import "./lookup-D0je8AqR.js";
|
|
26
|
-
import "./inbox-DAAZZl2k.js";
|
|
27
|
-
import "./builder-mi6RdzNE.js";
|
|
28
|
-
import "./collection-Dfb0TPno.js";
|
|
29
|
-
import "./keycache-C1pEuRyQ.js";
|
|
30
|
-
import "./retry-BiIhZWgD.js";
|
|
31
|
-
import "./send-DdxfTHo6.js";
|
|
32
|
-
|
|
33
|
-
export { FederationImpl };
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { Temporal } from "@js-temporal/polyfill";
|
|
3
|
-
import { URLPattern } from "urlpattern-polyfill";
|
|
4
|
-
|
|
5
|
-
import "./transformers-ghwJuzGY.js";
|
|
6
|
-
import "./docloader-DJxET2fN.js";
|
|
7
|
-
import "./actor-GZRoTRqg.js";
|
|
8
|
-
import { ContextImpl, FederationImpl, InboxContextImpl, KvSpecDeterminer, createFederation } from "./middleware-DlDXugwZ.js";
|
|
9
|
-
import "./lookup-CSngxuWm.js";
|
|
10
|
-
import "./key-DmqJj57e.js";
|
|
11
|
-
import "./http-vqMAvOVs.js";
|
|
12
|
-
import "./proof-DlI7QNdn.js";
|
|
13
|
-
import "./types-CmVV9LT1.js";
|
|
14
|
-
import "./authdocloader-BopfyipD.js";
|
|
15
|
-
import "./vocab-BebR0kAy.js";
|
|
16
|
-
|
|
17
|
-
export { FederationImpl };
|