@fedify/fedify 1.9.6 → 1.9.8
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-CEGEmRll.js → actor-BTA45fXF.js} +1205 -2768
- package/dist/{actor-Ydzhc8dj.d.cts → actor-Be-68iJP.d.cts} +3 -3
- package/dist/{actor-C1Euqngb.d.ts → actor-C5AY0Tno.d.ts} +3 -3
- package/dist/{actor-DbpZ6pzg.js → actor-DGa1EWaV.mjs} +8 -15
- package/dist/{actor-DlS-Q8hE.cjs → actor-DxfJk4lY.cjs} +3112 -4674
- package/dist/{assert-MZs1qjMx.js → assert-DikXweDx.mjs} +5 -9
- package/dist/{assert_equals-DSbWqCm3.js → assert_equals-Ew3jOFa3.mjs} +55 -69
- package/dist/{assert_instance_of-DHz7EHNU.js → assert_instance_of-C4Ri6VuN.mjs} +5 -9
- package/dist/{assert_is_error-BPGph1Jx.js → assert_is_error-C50x8tnw.mjs} +5 -9
- package/dist/{assert_not_equals-f3m3epl3.js → assert_not_equals--wG9hV7u.mjs} +6 -13
- package/dist/{assert_rejects-DiIiJbZn.js → assert_rejects-CJC9ThS-.mjs} +6 -11
- package/dist/{assert_throws-BOO88avQ.js → assert_throws-BIL7gChy.mjs} +6 -10
- package/dist/{authdocloader-DUQcOTRS.js → authdocloader-BC2rYCy1.mjs} +9 -14
- package/dist/{authdocloader-CT_V4Z7G.cjs → authdocloader-BrhFB421.cjs} +14 -22
- package/dist/{authdocloader-BLqMyboS.js → authdocloader-CqtNsX_N.js} +8 -15
- package/dist/{builder-BO61xeXE.js → builder-CIkAhIGC.mjs} +31 -40
- package/dist/{client-DF8anIB5.d.ts → client-D8OSiPBT.d.ts} +2 -2
- package/dist/{client-UG5wpNhG.js → client-MXqit6c-.mjs} +11 -15
- package/dist/{client-DjT_tegg.d.cts → client-T0VFOdMw.d.cts} +2 -2
- package/dist/{collection-CSzG2j1P.js → collection-BD6-SZ6O.mjs} +7 -12
- package/dist/compat/mod.cjs +5 -8
- package/dist/compat/mod.d.cts +78 -12
- package/dist/compat/mod.d.ts +78 -12
- package/dist/compat/mod.js +4 -8
- package/dist/compat/transformers.test.mjs +62 -0
- package/dist/{context-CwUAkopp.d.cts → context-CACMqDzl.d.cts} +33 -26
- package/dist/{context-CXUibY4L.d.ts → context-K4cCphQj.d.ts} +33 -26
- package/dist/{denokv-Bv33Xxea.js → denokv-CoSB_Eps.mjs} +22 -11
- package/dist/{docloader-BIFI3OS7.cjs → docloader-BVuUhBLI.cjs} +112 -212
- package/dist/{docloader-fJgJeqiX.js → docloader-BoXhusJ1.js} +17 -151
- package/dist/{docloader-CxWcuWqQ.d.ts → docloader-DSaLRXEA.d.ts} +2 -7
- package/dist/{docloader-D-MrRyHl.d.cts → docloader-DpGRDZrn.d.cts} +2 -7
- package/dist/{esm-C1EfGjSS.js → esm-BHJ7sdNg.mjs} +49 -85
- package/dist/federation/{builder.test.js → builder.test.mjs} +22 -41
- package/dist/federation/collection.test.d.mts +2 -0
- package/dist/federation/collection.test.mjs +21 -0
- package/dist/federation/handler.test.d.mts +2 -0
- package/dist/federation/{handler.test.js → handler.test.mjs} +22 -49
- package/dist/federation/idempotency.test.d.mts +2 -0
- package/dist/federation/{idempotency.test.js → idempotency.test.mjs} +29 -59
- package/dist/federation/inbox.test.d.mts +2 -0
- package/dist/federation/{inbox.test.js → inbox.test.mjs} +10 -15
- package/dist/federation/keycache.test.d.mts +2 -0
- package/dist/federation/{keycache.test.js → keycache.test.mjs} +13 -18
- package/dist/federation/kv.test.d.mts +2 -0
- package/dist/federation/{kv.test.js → kv.test.mjs} +9 -20
- package/dist/federation/middleware.test.d.mts +2 -0
- package/dist/federation/{middleware.test.js → middleware.test.mjs} +182 -197
- package/dist/federation/mod.cjs +223 -21
- package/dist/federation/mod.d.cts +4 -13
- package/dist/federation/mod.d.ts +4 -13
- package/dist/federation/mod.js +218 -18
- package/dist/federation/mq.test.d.mts +2 -0
- package/dist/federation/{mq.test.js → mq.test.mjs} +23 -38
- package/dist/federation/retry.test.d.mts +2 -0
- package/dist/federation/{retry.test.js → retry.test.mjs} +9 -14
- package/dist/federation/router.test.d.mts +2 -0
- package/dist/federation/{router.test.js → router.test.mjs} +12 -19
- package/dist/federation/send.test.d.mts +2 -0
- package/dist/federation/{send.test.js → send.test.mjs} +17 -26
- package/dist/{http-wsGR6KkT.d.ts → http-BZpls--H.d.ts} +5 -9
- package/dist/{http-CR-Eg1Uq.js → http-Bu5ZNlhZ.mjs} +16 -32
- package/dist/{http-B1_DzfAU.d.cts → http-C7WoprmE.d.cts} +5 -9
- package/dist/{http-BgopPF-8.cjs → http-DKw-O_VY.cjs} +51 -68
- package/dist/{http-05HxN-lp.js → http-VJbz6sKD.js} +17 -33
- package/dist/{inbox-DcJN1cxM.js → inbox-DkbTULXE.mjs} +17 -25
- package/dist/key-4fu6v0Jf.mjs +5 -0
- package/dist/{key-DjS1X9TG.cjs → key-B-wFdaPB.cjs} +42 -50
- package/dist/{key-ibMO03_0.js → key-BNMK_IVr.mjs} +12 -18
- package/dist/key-CancShOo.cjs +4 -0
- package/dist/{key-CPJcJjp-.js → key-DK3o0FEH.js} +19 -19
- package/dist/{keycache-CMUfqYqr.js → keycache-D-Vj8z88.mjs} +6 -10
- package/dist/{keys-IZ5050fT.js → keys-B27nVeIs.mjs} +6 -10
- package/dist/{kv-C7sopW2E.d.ts → kv-Bq9QLKm5.d.ts} +1 -1
- package/dist/{kv-CRZrzyXm.js → kv-DM1zFCtL.mjs} +6 -10
- package/dist/{kv-63Cil1MD.d.cts → kv-GIrOktyG.d.cts} +1 -1
- package/dist/{ld-DHNA2RSQ.js → ld-6jAVu3jV.mjs} +17 -31
- package/dist/{lookup-CKZfuyxA.js → lookup-BaU75j-d.js} +5 -11
- package/dist/{lookup-C4_dVYz7.cjs → lookup-BiIPmTwB.cjs} +16 -23
- package/dist/{lookup-BMAWLsP2.js → lookup-DmeJ8WUw.mjs} +8 -17
- package/dist/middleware-9ByEpBvV.cjs +4 -0
- package/dist/{middleware-CGbvIGvy.cjs → middleware-C188G4Go.cjs} +494 -547
- package/dist/{middleware-DrhEvfTo.js → middleware-Db1yZQaT.mjs} +276 -321
- package/dist/{middleware-ODfDRN3q.js → middleware-Do06X21v.js} +349 -393
- package/dist/middleware-DrfZEjyc.mjs +5 -0
- package/dist/{mod-CDObsV1d.d.ts → mod-BSwc3_rD.d.ts} +3 -3
- package/dist/{mod-DBzN0aCM.d.ts → mod-BTNpXcPj.d.ts} +2 -2
- package/dist/{mod-fjqfsrty.d.cts → mod-Chb_NKPp.d.cts} +4 -4
- package/dist/{mod-DgcYoyZK.d.ts → mod-DHoc3toL.d.ts} +4 -4
- package/dist/{mod-jQ4OODsl.d.cts → mod-DIMx6YjJ.d.cts} +2 -2
- package/dist/{mod-BUbqxBev.d.cts → mod-HElaq2UB.d.cts} +3 -3
- package/dist/mod.cjs +31 -33
- package/dist/mod.d.cts +15 -17
- package/dist/mod.d.ts +15 -17
- package/dist/mod.js +20 -23
- package/dist/{mq-B7R1Q-M5.d.cts → mq-CrItclRD.d.cts} +1 -1
- package/dist/{mq-CRGm1e_F.d.ts → mq-D_ZZRdby.d.ts} +1 -1
- package/dist/nodeinfo/client.test.d.mts +2 -0
- package/dist/nodeinfo/{client.test.js → client.test.mjs} +23 -45
- package/dist/nodeinfo/handler.test.d.mts +2 -0
- package/dist/nodeinfo/{handler.test.js → handler.test.mjs} +14 -43
- package/dist/nodeinfo/mod.cjs +5 -9
- package/dist/nodeinfo/mod.d.cts +2 -5
- package/dist/nodeinfo/mod.d.ts +2 -5
- package/dist/nodeinfo/mod.js +4 -9
- package/dist/nodeinfo/semver.test.d.mts +2 -0
- package/dist/nodeinfo/{semver.test.js → semver.test.mjs} +28 -51
- package/dist/nodeinfo/types.test.d.mts +2 -0
- package/dist/nodeinfo/{types.test.js → types.test.mjs} +10 -21
- package/dist/{owner-DDHsHYQO.js → owner-CKuGt_T9.mjs} +10 -13
- package/dist/{owner-BbeUDvOu.d.ts → owner-DPAPnB0R.d.ts} +4 -4
- package/dist/{owner-6KSEp9eV.d.cts → owner-_rFs0ik_.d.cts} +4 -4
- package/dist/{proof-V1uQaB2y.js → proof-CmTtG_t-.js} +33 -57
- package/dist/{proof-CX7ujFFX.cjs → proof-DLOy7HYU.cjs} +112 -135
- package/dist/{proof-exgGRW88.js → proof-mJLL2gSA.mjs} +20 -32
- package/dist/{retry-D4GJ670a.js → retry-Ddbq3AcK.mjs} +4 -7
- package/dist/rolldown-runtime-C7fyD9f2.js +15 -0
- package/dist/runtime/authdocloader.test.d.mts +2 -0
- package/dist/runtime/{authdocloader.test.js → authdocloader.test.mjs} +16 -28
- package/dist/runtime/docloader.test.d.mts +2 -0
- package/dist/runtime/{docloader.test.js → docloader.test.mjs} +52 -72
- package/dist/runtime/key.test.d.mts +2 -0
- package/dist/runtime/{key.test.js → key.test.mjs} +27 -57
- package/dist/runtime/langstr.test.d.mts +2 -0
- package/dist/runtime/{langstr.test.js → langstr.test.mjs} +9 -19
- package/dist/runtime/link.test.d.mts +2 -0
- package/dist/runtime/{link.test.js → link.test.mjs} +7 -11
- package/dist/runtime/mod.cjs +7 -13
- package/dist/runtime/mod.d.cts +103 -6
- package/dist/runtime/mod.d.ts +103 -6
- package/dist/runtime/mod.js +6 -13
- package/dist/runtime/multibase/multibase.test.d.mts +2 -0
- package/dist/runtime/multibase/{multibase.test.js → multibase.test.mjs} +16 -33
- package/dist/runtime/url.test.d.mts +2 -0
- package/dist/runtime/{url.test.js → url.test.mjs} +10 -15
- package/dist/{semver-dArNLkR9.js → semver-CgD82xxg.mjs} +13 -28
- package/dist/{send-BfMYakUE.js → send-BsQbGuw4.mjs} +7 -12
- package/dist/sig/http.test.d.mts +2 -0
- package/dist/sig/{http.test.js → http.test.mjs} +119 -203
- package/dist/sig/key.test.d.mts +2 -0
- package/dist/sig/{key.test.js → key.test.mjs} +13 -22
- package/dist/sig/ld.test.d.mts +2 -0
- package/dist/sig/{ld.test.js → ld.test.mjs} +24 -39
- package/dist/sig/mod.cjs +7 -13
- package/dist/sig/mod.d.cts +3 -7
- package/dist/sig/mod.d.ts +3 -7
- package/dist/sig/mod.js +6 -13
- package/dist/sig/owner.test.d.mts +2 -0
- package/dist/sig/owner.test.mjs +39 -0
- package/dist/sig/proof.test.d.mts +2 -0
- package/dist/sig/{proof.test.js → proof.test.mjs} +18 -31
- package/dist/{std__assert-X-_kMxKM.js → std__assert-2v7gYiZp.mjs} +13 -24
- package/dist/testing/docloader.test.d.mts +2 -0
- package/dist/testing/docloader.test.mjs +12 -0
- package/dist/testing/{mod.d.ts → mod.d.mts} +371 -541
- package/dist/testing/mod.mjs +5 -0
- package/dist/{testing-RPOc_gVG.js → testing-DS3gcq8V.mjs} +27 -35
- package/dist/{transformers-CoBS-oFG.cjs → transformers-BM0M8hnW.cjs} +20 -25
- package/dist/{transformers-BFT6d7J5.js → transformers-BV4OeK9o.js} +3 -7
- package/dist/{types-Cptev2nt.js → types-BXfL-dsX.js} +18 -36
- package/dist/{types-BIgY6c-l.js → types-CAnkAQGM.mjs} +5 -9
- package/dist/{types-CGnM1vft.cjs → types-DpM4FhjW.cjs} +45 -64
- package/dist/vocab/actor.test.d.mts +2 -0
- package/dist/vocab/{actor.test.js → actor.test.mjs} +308 -550
- package/dist/vocab/cjs.test.d.mts +2 -0
- package/dist/vocab/cjs.test.mjs +14 -0
- package/dist/vocab/lookup.test.d.mts +2 -0
- package/dist/vocab/{lookup.test.js → lookup.test.mjs} +29 -45
- package/dist/vocab/mod.cjs +251 -16
- package/dist/vocab/mod.d.cts +3 -5
- package/dist/vocab/mod.d.ts +3 -5
- package/dist/vocab/mod.js +244 -10
- package/dist/vocab/type.test.d.mts +2 -0
- package/dist/vocab/type.test.mjs +16 -0
- package/dist/vocab/vocab.test.d.mts +2 -0
- package/dist/vocab/{vocab.test.js → vocab.test.mjs} +178 -311
- package/dist/{vocab-CDHNj5zp.d.ts → vocab-BLvSEtuz.d.cts} +2 -4
- package/dist/{type-COPv6pMi.js → vocab-DuW9rL1h.mjs} +1177 -2871
- package/dist/{vocab-Cfs0937i.d.cts → vocab-lhCS9lzq.d.ts} +4 -2
- package/dist/webfinger/handler.test.d.mts +2 -0
- package/dist/webfinger/{handler.test.js → handler.test.mjs} +23 -56
- package/dist/webfinger/lookup.test.d.mts +2 -0
- package/dist/webfinger/{lookup.test.js → lookup.test.mjs} +13 -27
- package/dist/webfinger/mod.cjs +5 -9
- package/dist/webfinger/mod.d.cts +1 -3
- package/dist/webfinger/mod.d.ts +1 -3
- package/dist/webfinger/mod.js +4 -9
- package/dist/x/cfworkers.cjs +25 -14
- package/dist/x/cfworkers.d.cts +33 -6
- package/dist/x/cfworkers.d.ts +33 -6
- package/dist/x/cfworkers.js +22 -12
- package/dist/x/cfworkers.test.d.mts +2 -0
- package/dist/x/{cfworkers.test.js → cfworkers.test.mjs} +28 -26
- package/dist/x/hono.cjs +25 -14
- package/dist/x/hono.d.cts +1 -11
- package/dist/x/hono.d.ts +1 -11
- package/dist/x/hono.js +22 -12
- package/dist/x/sveltekit.cjs +23 -12
- package/dist/x/sveltekit.d.cts +1 -11
- package/dist/x/sveltekit.d.ts +1 -11
- package/dist/x/sveltekit.js +20 -10
- package/package.json +2 -2
- package/dist/chunk-DqRYRqnO.cjs +0 -34
- package/dist/compat/transformers.test.d.ts +0 -3
- package/dist/compat/transformers.test.js +0 -86
- package/dist/compat-DmDDELst.cjs +0 -4
- package/dist/compat-nxUqe4Z-.js +0 -4
- package/dist/federation/builder.test.d.ts +0 -3
- package/dist/federation/collection.test.d.ts +0 -3
- package/dist/federation/collection.test.js +0 -35
- package/dist/federation/handler.test.d.ts +0 -3
- package/dist/federation/idempotency.test.d.ts +0 -3
- package/dist/federation/inbox.test.d.ts +0 -3
- package/dist/federation/keycache.test.d.ts +0 -3
- package/dist/federation/kv.test.d.ts +0 -3
- package/dist/federation/middleware.test.d.ts +0 -3
- package/dist/federation/mq.test.d.ts +0 -3
- package/dist/federation/retry.test.d.ts +0 -3
- package/dist/federation/router.test.d.ts +0 -3
- package/dist/federation/send.test.d.ts +0 -3
- package/dist/federation-D1U8YY9t.js +0 -226
- package/dist/federation-H2_En3j5.cjs +0 -244
- package/dist/key-BCUd8FWp.js +0 -10
- package/dist/key-BUardnTH.cjs +0 -10
- package/dist/key-Dr6H_e3K.js +0 -10
- package/dist/middleware-BJ83veqi.js +0 -26
- package/dist/middleware-CJ4W2ir5.cjs +0 -17
- package/dist/middleware-Ve2mHJgo.js +0 -17
- package/dist/mod-BcObK1Lz.d.ts +0 -82
- package/dist/mod-C2tOeRkN.d.cts +0 -1
- package/dist/mod-CIbqfZW0.d.ts +0 -104
- package/dist/mod-Dt-G9ZOS.d.cts +0 -102
- package/dist/mod-FZd39qVq.d.cts +0 -1
- package/dist/mod-mXx9V0q5.d.cts +0 -80
- package/dist/nodeinfo/client.test.d.ts +0 -3
- package/dist/nodeinfo/handler.test.d.ts +0 -3
- package/dist/nodeinfo/semver.test.d.ts +0 -3
- package/dist/nodeinfo/types.test.d.ts +0 -3
- package/dist/nodeinfo-Co9lJrWl.cjs +0 -4
- package/dist/nodeinfo-DfycQ8Wf.js +0 -4
- package/dist/runtime/authdocloader.test.d.ts +0 -3
- package/dist/runtime/docloader.test.d.ts +0 -3
- package/dist/runtime/key.test.d.ts +0 -3
- package/dist/runtime/langstr.test.d.ts +0 -3
- package/dist/runtime/link.test.d.ts +0 -3
- package/dist/runtime/multibase/multibase.test.d.ts +0 -3
- package/dist/runtime/url.test.d.ts +0 -3
- package/dist/runtime-C58AJWSv.cjs +0 -4
- package/dist/runtime-DPYEDf-o.js +0 -4
- package/dist/sig/http.test.d.ts +0 -3
- package/dist/sig/key.test.d.ts +0 -3
- package/dist/sig/ld.test.d.ts +0 -3
- package/dist/sig/owner.test.d.ts +0 -3
- package/dist/sig/owner.test.js +0 -52
- package/dist/sig/proof.test.d.ts +0 -3
- package/dist/sig-ByHXzqUi.cjs +0 -4
- package/dist/sig-Cj3tk-ig.js +0 -4
- package/dist/testing/docloader.test.d.ts +0 -3
- package/dist/testing/docloader.test.js +0 -24
- package/dist/testing/mod.js +0 -10
- package/dist/vocab/actor.test.d.ts +0 -3
- package/dist/vocab/lookup.test.d.ts +0 -3
- package/dist/vocab/type.test.d.ts +0 -3
- package/dist/vocab/type.test.js +0 -25
- package/dist/vocab/vocab.test.d.ts +0 -3
- package/dist/vocab-BFy1CS5L.cjs +0 -289
- package/dist/vocab-BPFiQ650.js +0 -253
- package/dist/webfinger/handler.test.d.ts +0 -3
- package/dist/webfinger/lookup.test.d.ts +0 -3
- package/dist/webfinger-BjOEdFPs.cjs +0 -4
- package/dist/webfinger-De_bU0iE.js +0 -4
- package/dist/x/cfworkers.test.d.ts +0 -3
- /package/dist/{mod-1pDWKvUL.d.ts → compat/transformers.test.d.mts} +0 -0
- /package/dist/{mod-g0xFzAP9.d.ts → federation/builder.test.d.mts} +0 -0
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Temporal } from "@js-temporal/polyfill";
|
|
2
|
+
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
+
import { n as DocumentLoader } from "./docloader-DSaLRXEA.js";
|
|
2
4
|
import { Span, TracerProvider } from "@opentelemetry/api";
|
|
3
5
|
import { LanguageTag } from "@phensley/language-tag";
|
|
4
6
|
|
|
@@ -14916,4 +14918,4 @@ declare class View extends Activity {
|
|
|
14916
14918
|
protected _getCustomInspectProxy(): Record<string, unknown>;
|
|
14917
14919
|
}
|
|
14918
14920
|
//#endregion
|
|
14919
|
-
export {
|
|
14921
|
+
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 };
|
|
@@ -1,49 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import "../
|
|
9
|
-
import "../
|
|
10
|
-
import { MemoryKvStore } from "../kv-CRZrzyXm.js";
|
|
11
|
-
import { createFederation, handleWebFinger } from "../middleware-DrhEvfTo.js";
|
|
12
|
-
import "../semver-dArNLkR9.js";
|
|
13
|
-
import "../client-UG5wpNhG.js";
|
|
14
|
-
import "../lookup-BMAWLsP2.js";
|
|
15
|
-
import "../types-BIgY6c-l.js";
|
|
16
|
-
import "../actor-DbpZ6pzg.js";
|
|
17
|
-
import "../key-CPJcJjp-.js";
|
|
18
|
-
import "../http-05HxN-lp.js";
|
|
19
|
-
import "../authdocloader-BLqMyboS.js";
|
|
20
|
-
import "../ld-DHNA2RSQ.js";
|
|
21
|
-
import "../owner-DDHsHYQO.js";
|
|
22
|
-
import "../proof-exgGRW88.js";
|
|
23
|
-
import "../inbox-DcJN1cxM.js";
|
|
24
|
-
import "../builder-BO61xeXE.js";
|
|
25
|
-
import "../collection-CSzG2j1P.js";
|
|
26
|
-
import "../keycache-CMUfqYqr.js";
|
|
27
|
-
import "../retry-D4GJ670a.js";
|
|
28
|
-
import "../send-BfMYakUE.js";
|
|
29
|
-
import { createRequestContext, test } from "../testing-RPOc_gVG.js";
|
|
30
|
-
import "../std__assert-X-_kMxKM.js";
|
|
31
|
-
import "../assert_rejects-DiIiJbZn.js";
|
|
32
|
-
import "../assert_is_error-BPGph1Jx.js";
|
|
33
|
-
import "../assert_not_equals-f3m3epl3.js";
|
|
34
|
-
import "../assert_throws-BOO88avQ.js";
|
|
35
|
-
|
|
1
|
+
import "@js-temporal/polyfill";
|
|
2
|
+
import "urlpattern-polyfill";
|
|
3
|
+
globalThis.addEventListener = () => {};
|
|
4
|
+
import { C as Person, h as Link, p as Image } from "../vocab-DuW9rL1h.mjs";
|
|
5
|
+
import { i as createRequestContext, t as test } from "../testing-DS3gcq8V.mjs";
|
|
6
|
+
import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
|
|
7
|
+
import "../std__assert-2v7gYiZp.mjs";
|
|
8
|
+
import { t as MemoryKvStore } from "../kv-DM1zFCtL.mjs";
|
|
9
|
+
import { a as createFederation, m as handleWebFinger } from "../middleware-Db1yZQaT.mjs";
|
|
36
10
|
//#region src/webfinger/handler.test.ts
|
|
37
11
|
test("handleWebFinger()", async (t) => {
|
|
38
12
|
const url = new URL("https://example.com/.well-known/webfinger");
|
|
39
|
-
function createContext(url
|
|
40
|
-
const federation = createFederation({ kv: new MemoryKvStore() });
|
|
13
|
+
function createContext(url) {
|
|
41
14
|
const context = createRequestContext({
|
|
42
|
-
federation,
|
|
43
|
-
url
|
|
15
|
+
federation: createFederation({ kv: new MemoryKvStore() }),
|
|
16
|
+
url,
|
|
44
17
|
data: void 0,
|
|
45
18
|
getActorUri(identifier) {
|
|
46
|
-
return new URL(`${url
|
|
19
|
+
return new URL(`${url.origin}/users/${identifier}`);
|
|
47
20
|
},
|
|
48
21
|
async getActor(handle) {
|
|
49
22
|
return await actorDispatcher(context, handle);
|
|
@@ -53,10 +26,9 @@ test("handleWebFinger()", async (t) => {
|
|
|
53
26
|
if (uri.protocol === "acct:") return null;
|
|
54
27
|
if (!uri.pathname.startsWith("/users/")) return null;
|
|
55
28
|
const paths = uri.pathname.split("/");
|
|
56
|
-
const identifier = paths[paths.length - 1];
|
|
57
29
|
return {
|
|
58
30
|
type: "actor",
|
|
59
|
-
identifier,
|
|
31
|
+
identifier: paths[paths.length - 1],
|
|
60
32
|
get handle() {
|
|
61
33
|
throw new Error("ParseUriResult.handle is deprecated!");
|
|
62
34
|
}
|
|
@@ -91,11 +63,10 @@ test("handleWebFinger()", async (t) => {
|
|
|
91
63
|
await t.step("no actor dispatcher", async () => {
|
|
92
64
|
const context = createContext(url);
|
|
93
65
|
const request = context.request;
|
|
94
|
-
|
|
66
|
+
assertEquals((await handleWebFinger(request, {
|
|
95
67
|
context,
|
|
96
68
|
onNotFound
|
|
97
|
-
});
|
|
98
|
-
assertEquals(response.status, 404);
|
|
69
|
+
})).status, 404);
|
|
99
70
|
assertEquals(onNotFoundCalled, request);
|
|
100
71
|
});
|
|
101
72
|
onNotFoundCalled = null;
|
|
@@ -115,8 +86,7 @@ test("handleWebFinger()", async (t) => {
|
|
|
115
86
|
const u = new URL(url);
|
|
116
87
|
u.searchParams.set("resource", " invalid ");
|
|
117
88
|
const context = createContext(u);
|
|
118
|
-
const
|
|
119
|
-
const response = await handleWebFinger(request, {
|
|
89
|
+
const response = await handleWebFinger(new Request(u), {
|
|
120
90
|
context,
|
|
121
91
|
actorDispatcher,
|
|
122
92
|
onNotFound
|
|
@@ -222,12 +192,11 @@ test("handleWebFinger()", async (t) => {
|
|
|
222
192
|
u.searchParams.set("resource", "acct:no-one@example.com");
|
|
223
193
|
const context = createContext(u);
|
|
224
194
|
const request = context.request;
|
|
225
|
-
|
|
195
|
+
assertEquals((await handleWebFinger(request, {
|
|
226
196
|
context,
|
|
227
197
|
actorDispatcher,
|
|
228
198
|
onNotFound
|
|
229
|
-
});
|
|
230
|
-
assertEquals(response.status, 404);
|
|
199
|
+
})).status, 404);
|
|
231
200
|
assertEquals(onNotFoundCalled, request);
|
|
232
201
|
});
|
|
233
202
|
onNotFoundCalled = null;
|
|
@@ -523,16 +492,14 @@ test("handleWebFinger()", async (t) => {
|
|
|
523
492
|
onNotFound
|
|
524
493
|
});
|
|
525
494
|
assertEquals(response.status, 200);
|
|
526
|
-
|
|
527
|
-
const expectedWithCustomLinks = {
|
|
495
|
+
assertEquals(await response.json(), {
|
|
528
496
|
...expected,
|
|
529
497
|
links: [...expected.links, {
|
|
530
498
|
rel: "http://ostatus.org/schema/1.0/subscribe",
|
|
531
499
|
template: "https://example.com/follow?acct={uri}"
|
|
532
500
|
}]
|
|
533
|
-
};
|
|
534
|
-
assertEquals(result, expectedWithCustomLinks);
|
|
501
|
+
});
|
|
535
502
|
});
|
|
536
503
|
});
|
|
537
|
-
|
|
538
|
-
|
|
504
|
+
//#endregion
|
|
505
|
+
export {};
|
|
@@ -1,22 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import "../
|
|
9
|
-
import "../assert_instance_of-DHz7EHNU.js";
|
|
10
|
-
import "../lookup-BMAWLsP2.js";
|
|
11
|
-
import { test } from "../testing-RPOc_gVG.js";
|
|
12
|
-
import "../std__assert-X-_kMxKM.js";
|
|
13
|
-
import "../assert_rejects-DiIiJbZn.js";
|
|
14
|
-
import "../assert_is_error-BPGph1Jx.js";
|
|
15
|
-
import "../assert_not_equals-f3m3epl3.js";
|
|
16
|
-
import "../assert_throws-BOO88avQ.js";
|
|
17
|
-
import { esm_default } from "../esm-C1EfGjSS.js";
|
|
1
|
+
import "@js-temporal/polyfill";
|
|
2
|
+
import "urlpattern-polyfill";
|
|
3
|
+
globalThis.addEventListener = () => {};
|
|
4
|
+
import { W as lookupWebFinger } from "../vocab-DuW9rL1h.mjs";
|
|
5
|
+
import { t as test } from "../testing-DS3gcq8V.mjs";
|
|
6
|
+
import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
|
|
7
|
+
import "../std__assert-2v7gYiZp.mjs";
|
|
8
|
+
import { t as esm_default } from "../esm-BHJ7sdNg.mjs";
|
|
18
9
|
import { withTimeout } from "es-toolkit";
|
|
19
|
-
|
|
20
10
|
//#region src/webfinger/lookup.test.ts
|
|
21
11
|
test({
|
|
22
12
|
name: "lookupWebFinger()",
|
|
@@ -97,8 +87,7 @@ test({
|
|
|
97
87
|
headers: { Location: "/.well-known/webfinger" }
|
|
98
88
|
});
|
|
99
89
|
await t.step("infinite redirection", async () => {
|
|
100
|
-
|
|
101
|
-
assertEquals(result, null);
|
|
90
|
+
assertEquals(await withTimeout(() => lookupWebFinger("acct:johndoe@example.com"), 2e3), null);
|
|
102
91
|
});
|
|
103
92
|
esm_default.removeRoutes();
|
|
104
93
|
esm_default.get("begin:https://example.com/.well-known/webfinger?", {
|
|
@@ -178,18 +167,15 @@ test({
|
|
|
178
167
|
await t.step("cancellation with immediate abort", async () => {
|
|
179
168
|
const controller = new AbortController();
|
|
180
169
|
controller.abort();
|
|
181
|
-
|
|
182
|
-
assertEquals(result, null);
|
|
170
|
+
assertEquals(await lookupWebFinger("acct:johndoe@example.com", { signal: controller.signal }), null);
|
|
183
171
|
});
|
|
184
172
|
esm_default.removeRoutes();
|
|
185
173
|
esm_default.get("begin:https://example.com/.well-known/webfinger?", { body: expected });
|
|
186
174
|
await t.step("successful request with signal", async () => {
|
|
187
|
-
|
|
188
|
-
const result = await lookupWebFinger("acct:johndoe@example.com", { signal: controller.signal });
|
|
189
|
-
assertEquals(result, expected);
|
|
175
|
+
assertEquals(await lookupWebFinger("acct:johndoe@example.com", { signal: new AbortController().signal }), expected);
|
|
190
176
|
});
|
|
191
177
|
esm_default.hardReset();
|
|
192
178
|
}
|
|
193
179
|
});
|
|
194
|
-
|
|
195
|
-
|
|
180
|
+
//#endregion
|
|
181
|
+
export {};
|
package/dist/webfinger/mod.cjs
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const require_lookup = require('../lookup-C4_dVYz7.cjs');
|
|
7
|
-
require('../webfinger-BjOEdFPs.cjs');
|
|
8
|
-
|
|
9
|
-
exports.lookupWebFinger = require_lookup.lookupWebFinger;
|
|
1
|
+
const { Temporal } = require("@js-temporal/polyfill");
|
|
2
|
+
const { URLPattern } = require("urlpattern-polyfill");
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
+
const require_lookup = require("../lookup-BiIPmTwB.cjs");
|
|
5
|
+
exports.lookupWebFinger = require_lookup.lookupWebFinger;
|
package/dist/webfinger/mod.d.cts
CHANGED
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
import "../
|
|
2
|
-
import "../docloader-D-MrRyHl.cjs";
|
|
3
|
-
import { Link, LookupWebFingerOptions, ResourceDescriptor, lookupWebFinger } from "../mod-jQ4OODsl.cjs";
|
|
1
|
+
import { i as ResourceDescriptor, n as lookupWebFinger, r as Link, t as LookupWebFingerOptions } from "../mod-DIMx6YjJ.cjs";
|
|
4
2
|
export { Link, LookupWebFingerOptions, ResourceDescriptor, lookupWebFinger };
|
package/dist/webfinger/mod.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
-
import "../
|
|
4
|
-
import "../docloader-CxWcuWqQ.js";
|
|
5
|
-
import { Link, LookupWebFingerOptions, ResourceDescriptor, lookupWebFinger } from "../mod-DBzN0aCM.js";
|
|
3
|
+
import { i as ResourceDescriptor, n as lookupWebFinger, r as Link, t as LookupWebFingerOptions } from "../mod-BTNpXcPj.js";
|
|
6
4
|
export { Link, LookupWebFingerOptions, ResourceDescriptor, lookupWebFinger };
|
package/dist/webfinger/mod.js
CHANGED
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import "../docloader-fJgJeqiX.js";
|
|
6
|
-
import { lookupWebFinger } from "../lookup-CKZfuyxA.js";
|
|
7
|
-
import "../webfinger-De_bU0iE.js";
|
|
8
|
-
|
|
9
|
-
export { lookupWebFinger };
|
|
1
|
+
import "@js-temporal/polyfill";
|
|
2
|
+
import "urlpattern-polyfill";
|
|
3
|
+
import { t as lookupWebFinger } from "../lookup-BaU75j-d.js";
|
|
4
|
+
export { lookupWebFinger };
|
package/dist/x/cfworkers.cjs
CHANGED
|
@@ -1,12 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const __logtape_logtape = require_chunk.__toESM(require("@logtape/logtape"));
|
|
7
|
-
|
|
1
|
+
const { Temporal } = require("@js-temporal/polyfill");
|
|
2
|
+
const { URLPattern } = require("urlpattern-polyfill");
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
+
require("../docloader-BVuUhBLI.cjs");
|
|
5
|
+
let _logtape_logtape = require("@logtape/logtape");
|
|
8
6
|
//#region src/x/cfworkers.ts
|
|
9
7
|
/**
|
|
8
|
+
* `KvStore` & `MessageQueue` adapters for Cloudflare Workers
|
|
9
|
+
* ==========================================================
|
|
10
|
+
*
|
|
11
|
+
* This module provides `KvStore` and `MessageQueue` implementations that use
|
|
12
|
+
* Cloudflare Workers' KV and Queues bindings, respectively.
|
|
13
|
+
*
|
|
14
|
+
* @deprecated This module has been moved to a separate package.
|
|
15
|
+
* Install and import from `@fedify/cfworkers` instead.
|
|
16
|
+
* This module will be removed in Fedify v2.0.
|
|
17
|
+
*
|
|
18
|
+
* @module
|
|
19
|
+
* @since 1.6.0
|
|
20
|
+
*/
|
|
21
|
+
/**
|
|
10
22
|
* Implementation of the {@link KvStore} interface for Cloudflare Workers KV
|
|
11
23
|
* binding. This class provides a wrapper around Cloudflare's KV namespace to
|
|
12
24
|
* store and retrieve JSON-serializable values using structured keys.
|
|
@@ -24,8 +36,7 @@ const __logtape_logtape = require_chunk.__toESM(require("@logtape/logtape"));
|
|
|
24
36
|
var WorkersKvStore = class {
|
|
25
37
|
#namespace;
|
|
26
38
|
constructor(namespace) {
|
|
27
|
-
|
|
28
|
-
logger.warn("The `@fedify/fedify/x/cfworkers` module is deprecated; use `WorkersKvStore` from `@fedify/cfworkers` package instead.");
|
|
39
|
+
(0, _logtape_logtape.getLogger)(["fedify", "cfworkers"]).warn("The `@fedify/fedify/x/cfworkers` module is deprecated; use `WorkersKvStore` from `@fedify/cfworkers` package instead.");
|
|
29
40
|
this.#namespace = namespace;
|
|
30
41
|
}
|
|
31
42
|
#encodeKey(key) {
|
|
@@ -34,7 +45,9 @@ var WorkersKvStore = class {
|
|
|
34
45
|
async get(key) {
|
|
35
46
|
const encodedKey = this.#encodeKey(key);
|
|
36
47
|
const { value, metadata } = await this.#namespace.getWithMetadata(encodedKey, "json");
|
|
37
|
-
|
|
48
|
+
if (value == null) return void 0;
|
|
49
|
+
if (metadata?.expires != null && metadata.expires < Date.now()) return;
|
|
50
|
+
return value;
|
|
38
51
|
}
|
|
39
52
|
async set(key, value, options) {
|
|
40
53
|
const encodedKey = this.#encodeKey(key);
|
|
@@ -73,8 +86,7 @@ var WorkersMessageQueue = class {
|
|
|
73
86
|
*/
|
|
74
87
|
nativeRetrial = true;
|
|
75
88
|
constructor(queue) {
|
|
76
|
-
|
|
77
|
-
logger.warn("The `@fedify/fedify/x/cfworkers` module is deprecated; use `WorkersMessageQueue` from `@fedify/cfworkers` package instead.");
|
|
89
|
+
(0, _logtape_logtape.getLogger)(["fedify", "cfworkers"]).warn("The `@fedify/fedify/x/cfworkers` module is deprecated; use `WorkersMessageQueue` from `@fedify/cfworkers` package instead.");
|
|
78
90
|
this.#queue = queue;
|
|
79
91
|
}
|
|
80
92
|
enqueue(message, options) {
|
|
@@ -94,7 +106,6 @@ var WorkersMessageQueue = class {
|
|
|
94
106
|
throw new TypeError("WorkersMessageQueue does not support listen(). Use Federation.processQueuedTask() method instead.");
|
|
95
107
|
}
|
|
96
108
|
};
|
|
97
|
-
|
|
98
109
|
//#endregion
|
|
99
110
|
exports.WorkersKvStore = WorkersKvStore;
|
|
100
|
-
exports.WorkersMessageQueue = WorkersMessageQueue;
|
|
111
|
+
exports.WorkersMessageQueue = WorkersMessageQueue;
|
package/dist/x/cfworkers.d.cts
CHANGED
|
@@ -1,9 +1,36 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { KVNamespace, Queue } from "@cloudflare/workers-types/experimental";
|
|
1
|
+
import { n as KvStore, r as KvStoreSetOptions, t as KvKey } from "../kv-GIrOktyG.cjs";
|
|
2
|
+
import { a as MessageQueueListenOptions, i as MessageQueueEnqueueOptions, r as MessageQueue } from "../mq-CrItclRD.cjs";
|
|
4
3
|
|
|
5
4
|
//#region src/x/cfworkers.d.ts
|
|
6
|
-
|
|
5
|
+
type WorkersQueueContentType = "bytes" | "json" | "text" | "v8";
|
|
6
|
+
interface WorkersKvGetWithMetadataResult<Value, Metadata> {
|
|
7
|
+
value: Value | null;
|
|
8
|
+
metadata: Metadata | null;
|
|
9
|
+
}
|
|
10
|
+
interface WorkersKvPutOptions {
|
|
11
|
+
expirationTtl?: number;
|
|
12
|
+
metadata?: unknown;
|
|
13
|
+
}
|
|
14
|
+
interface WorkersKvNamespace<Key extends string = string> {
|
|
15
|
+
getWithMetadata<ExpectedValue = unknown, Metadata = unknown>(key: Key, type: "json"): Promise<WorkersKvGetWithMetadataResult<ExpectedValue, Metadata>>;
|
|
16
|
+
put(key: Key, value: string, options?: WorkersKvPutOptions): Promise<void>;
|
|
17
|
+
delete(key: Key): Promise<void>;
|
|
18
|
+
}
|
|
19
|
+
interface WorkersQueueSendOptions {
|
|
20
|
+
contentType?: WorkersQueueContentType;
|
|
21
|
+
delaySeconds?: number;
|
|
22
|
+
}
|
|
23
|
+
interface WorkersQueueSendBatchOptions {
|
|
24
|
+
delaySeconds?: number;
|
|
25
|
+
}
|
|
26
|
+
interface WorkersMessageSendRequest<Body = unknown> {
|
|
27
|
+
body: Body;
|
|
28
|
+
contentType?: WorkersQueueContentType;
|
|
29
|
+
}
|
|
30
|
+
interface WorkersQueue<Body = unknown> {
|
|
31
|
+
send(body: Body, options?: WorkersQueueSendOptions): Promise<void>;
|
|
32
|
+
sendBatch(requests: WorkersMessageSendRequest<Body>[], options?: WorkersQueueSendBatchOptions): Promise<void>;
|
|
33
|
+
}
|
|
7
34
|
/**
|
|
8
35
|
* Implementation of the {@link KvStore} interface for Cloudflare Workers KV
|
|
9
36
|
* binding. This class provides a wrapper around Cloudflare's KV namespace to
|
|
@@ -21,7 +48,7 @@ import { KVNamespace, Queue } from "@cloudflare/workers-types/experimental";
|
|
|
21
48
|
*/
|
|
22
49
|
declare class WorkersKvStore implements KvStore {
|
|
23
50
|
#private;
|
|
24
|
-
constructor(namespace:
|
|
51
|
+
constructor(namespace: WorkersKvNamespace<string>);
|
|
25
52
|
get<T = unknown>(key: KvKey): Promise<T | undefined>;
|
|
26
53
|
set(key: KvKey, value: unknown, options?: KvStoreSetOptions): Promise<void>;
|
|
27
54
|
delete(key: KvKey): Promise<void>;
|
|
@@ -50,7 +77,7 @@ declare class WorkersMessageQueue implements MessageQueue {
|
|
|
50
77
|
* @since 1.7.0
|
|
51
78
|
*/
|
|
52
79
|
readonly nativeRetrial = true;
|
|
53
|
-
constructor(queue:
|
|
80
|
+
constructor(queue: WorkersQueue);
|
|
54
81
|
enqueue(message: any, options?: MessageQueueEnqueueOptions): Promise<void>;
|
|
55
82
|
enqueueMany(messages: any[], options?: MessageQueueEnqueueOptions): Promise<void>;
|
|
56
83
|
listen(_handler: (message: any) => Promise<void> | void, _options?: MessageQueueListenOptions): Promise<void>;
|
package/dist/x/cfworkers.d.ts
CHANGED
|
@@ -1,11 +1,38 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { KVNamespace, Queue } from "@cloudflare/workers-types/experimental";
|
|
3
|
+
import { n as KvStore, r as KvStoreSetOptions, t as KvKey } from "../kv-Bq9QLKm5.js";
|
|
4
|
+
import { a as MessageQueueListenOptions, i as MessageQueueEnqueueOptions, r as MessageQueue } from "../mq-D_ZZRdby.js";
|
|
6
5
|
|
|
7
6
|
//#region src/x/cfworkers.d.ts
|
|
8
|
-
|
|
7
|
+
type WorkersQueueContentType = "bytes" | "json" | "text" | "v8";
|
|
8
|
+
interface WorkersKvGetWithMetadataResult<Value, Metadata> {
|
|
9
|
+
value: Value | null;
|
|
10
|
+
metadata: Metadata | null;
|
|
11
|
+
}
|
|
12
|
+
interface WorkersKvPutOptions {
|
|
13
|
+
expirationTtl?: number;
|
|
14
|
+
metadata?: unknown;
|
|
15
|
+
}
|
|
16
|
+
interface WorkersKvNamespace<Key extends string = string> {
|
|
17
|
+
getWithMetadata<ExpectedValue = unknown, Metadata = unknown>(key: Key, type: "json"): Promise<WorkersKvGetWithMetadataResult<ExpectedValue, Metadata>>;
|
|
18
|
+
put(key: Key, value: string, options?: WorkersKvPutOptions): Promise<void>;
|
|
19
|
+
delete(key: Key): Promise<void>;
|
|
20
|
+
}
|
|
21
|
+
interface WorkersQueueSendOptions {
|
|
22
|
+
contentType?: WorkersQueueContentType;
|
|
23
|
+
delaySeconds?: number;
|
|
24
|
+
}
|
|
25
|
+
interface WorkersQueueSendBatchOptions {
|
|
26
|
+
delaySeconds?: number;
|
|
27
|
+
}
|
|
28
|
+
interface WorkersMessageSendRequest<Body = unknown> {
|
|
29
|
+
body: Body;
|
|
30
|
+
contentType?: WorkersQueueContentType;
|
|
31
|
+
}
|
|
32
|
+
interface WorkersQueue<Body = unknown> {
|
|
33
|
+
send(body: Body, options?: WorkersQueueSendOptions): Promise<void>;
|
|
34
|
+
sendBatch(requests: WorkersMessageSendRequest<Body>[], options?: WorkersQueueSendBatchOptions): Promise<void>;
|
|
35
|
+
}
|
|
9
36
|
/**
|
|
10
37
|
* Implementation of the {@link KvStore} interface for Cloudflare Workers KV
|
|
11
38
|
* binding. This class provides a wrapper around Cloudflare's KV namespace to
|
|
@@ -23,7 +50,7 @@ import { KVNamespace, Queue } from "@cloudflare/workers-types/experimental";
|
|
|
23
50
|
*/
|
|
24
51
|
declare class WorkersKvStore implements KvStore {
|
|
25
52
|
#private;
|
|
26
|
-
constructor(namespace:
|
|
53
|
+
constructor(namespace: WorkersKvNamespace<string>);
|
|
27
54
|
get<T = unknown>(key: KvKey): Promise<T | undefined>;
|
|
28
55
|
set(key: KvKey, value: unknown, options?: KvStoreSetOptions): Promise<void>;
|
|
29
56
|
delete(key: KvKey): Promise<void>;
|
|
@@ -52,7 +79,7 @@ declare class WorkersMessageQueue implements MessageQueue {
|
|
|
52
79
|
* @since 1.7.0
|
|
53
80
|
*/
|
|
54
81
|
readonly nativeRetrial = true;
|
|
55
|
-
constructor(queue:
|
|
82
|
+
constructor(queue: WorkersQueue);
|
|
56
83
|
enqueue(message: any, options?: MessageQueueEnqueueOptions): Promise<void>;
|
|
57
84
|
enqueueMany(messages: any[], options?: MessageQueueEnqueueOptions): Promise<void>;
|
|
58
85
|
listen(_handler: (message: any) => Promise<void> | void, _options?: MessageQueueListenOptions): Promise<void>;
|
package/dist/x/cfworkers.js
CHANGED
|
@@ -1,11 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { URLPattern } from "urlpattern-polyfill";
|
|
4
|
-
|
|
1
|
+
import "@js-temporal/polyfill";
|
|
2
|
+
import "urlpattern-polyfill";
|
|
5
3
|
import { getLogger } from "@logtape/logtape";
|
|
6
|
-
|
|
7
4
|
//#region src/x/cfworkers.ts
|
|
8
5
|
/**
|
|
6
|
+
* `KvStore` & `MessageQueue` adapters for Cloudflare Workers
|
|
7
|
+
* ==========================================================
|
|
8
|
+
*
|
|
9
|
+
* This module provides `KvStore` and `MessageQueue` implementations that use
|
|
10
|
+
* Cloudflare Workers' KV and Queues bindings, respectively.
|
|
11
|
+
*
|
|
12
|
+
* @deprecated This module has been moved to a separate package.
|
|
13
|
+
* Install and import from `@fedify/cfworkers` instead.
|
|
14
|
+
* This module will be removed in Fedify v2.0.
|
|
15
|
+
*
|
|
16
|
+
* @module
|
|
17
|
+
* @since 1.6.0
|
|
18
|
+
*/
|
|
19
|
+
/**
|
|
9
20
|
* Implementation of the {@link KvStore} interface for Cloudflare Workers KV
|
|
10
21
|
* binding. This class provides a wrapper around Cloudflare's KV namespace to
|
|
11
22
|
* store and retrieve JSON-serializable values using structured keys.
|
|
@@ -23,8 +34,7 @@ import { getLogger } from "@logtape/logtape";
|
|
|
23
34
|
var WorkersKvStore = class {
|
|
24
35
|
#namespace;
|
|
25
36
|
constructor(namespace) {
|
|
26
|
-
|
|
27
|
-
logger.warn("The `@fedify/fedify/x/cfworkers` module is deprecated; use `WorkersKvStore` from `@fedify/cfworkers` package instead.");
|
|
37
|
+
getLogger(["fedify", "cfworkers"]).warn("The `@fedify/fedify/x/cfworkers` module is deprecated; use `WorkersKvStore` from `@fedify/cfworkers` package instead.");
|
|
28
38
|
this.#namespace = namespace;
|
|
29
39
|
}
|
|
30
40
|
#encodeKey(key) {
|
|
@@ -33,7 +43,9 @@ var WorkersKvStore = class {
|
|
|
33
43
|
async get(key) {
|
|
34
44
|
const encodedKey = this.#encodeKey(key);
|
|
35
45
|
const { value, metadata } = await this.#namespace.getWithMetadata(encodedKey, "json");
|
|
36
|
-
|
|
46
|
+
if (value == null) return void 0;
|
|
47
|
+
if (metadata?.expires != null && metadata.expires < Date.now()) return;
|
|
48
|
+
return value;
|
|
37
49
|
}
|
|
38
50
|
async set(key, value, options) {
|
|
39
51
|
const encodedKey = this.#encodeKey(key);
|
|
@@ -72,8 +84,7 @@ var WorkersMessageQueue = class {
|
|
|
72
84
|
*/
|
|
73
85
|
nativeRetrial = true;
|
|
74
86
|
constructor(queue) {
|
|
75
|
-
|
|
76
|
-
logger.warn("The `@fedify/fedify/x/cfworkers` module is deprecated; use `WorkersMessageQueue` from `@fedify/cfworkers` package instead.");
|
|
87
|
+
getLogger(["fedify", "cfworkers"]).warn("The `@fedify/fedify/x/cfworkers` module is deprecated; use `WorkersMessageQueue` from `@fedify/cfworkers` package instead.");
|
|
77
88
|
this.#queue = queue;
|
|
78
89
|
}
|
|
79
90
|
enqueue(message, options) {
|
|
@@ -93,6 +104,5 @@ var WorkersMessageQueue = class {
|
|
|
93
104
|
throw new TypeError("WorkersMessageQueue does not support listen(). Use Federation.processQueuedTask() method instead.");
|
|
94
105
|
}
|
|
95
106
|
};
|
|
96
|
-
|
|
97
107
|
//#endregion
|
|
98
|
-
export { WorkersKvStore, WorkersMessageQueue };
|
|
108
|
+
export { WorkersKvStore, WorkersMessageQueue };
|
|
@@ -1,24 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import "../
|
|
7
|
-
import { assertEquals } from "../assert_equals-DSbWqCm3.js";
|
|
8
|
-
import "../assert-MZs1qjMx.js";
|
|
9
|
-
import "../assert_instance_of-DHz7EHNU.js";
|
|
10
|
-
import "../lookup-BMAWLsP2.js";
|
|
11
|
-
import { test } from "../testing-RPOc_gVG.js";
|
|
12
|
-
import "../std__assert-X-_kMxKM.js";
|
|
13
|
-
import "../assert_rejects-DiIiJbZn.js";
|
|
14
|
-
import "../assert_is_error-BPGph1Jx.js";
|
|
15
|
-
import "../assert_not_equals-f3m3epl3.js";
|
|
16
|
-
import "../assert_throws-BOO88avQ.js";
|
|
17
|
-
import { delay } from "es-toolkit";
|
|
1
|
+
import { Temporal } from "@js-temporal/polyfill";
|
|
2
|
+
import "urlpattern-polyfill";
|
|
3
|
+
globalThis.addEventListener = () => {};
|
|
4
|
+
import { t as test } from "../testing-DS3gcq8V.mjs";
|
|
5
|
+
import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
|
|
6
|
+
import "../std__assert-2v7gYiZp.mjs";
|
|
18
7
|
import { getLogger } from "@logtape/logtape";
|
|
19
|
-
|
|
8
|
+
import { delay } from "es-toolkit";
|
|
20
9
|
//#region src/x/cfworkers.ts
|
|
21
10
|
/**
|
|
11
|
+
* `KvStore` & `MessageQueue` adapters for Cloudflare Workers
|
|
12
|
+
* ==========================================================
|
|
13
|
+
*
|
|
14
|
+
* This module provides `KvStore` and `MessageQueue` implementations that use
|
|
15
|
+
* Cloudflare Workers' KV and Queues bindings, respectively.
|
|
16
|
+
*
|
|
17
|
+
* @deprecated This module has been moved to a separate package.
|
|
18
|
+
* Install and import from `@fedify/cfworkers` instead.
|
|
19
|
+
* This module will be removed in Fedify v2.0.
|
|
20
|
+
*
|
|
21
|
+
* @module
|
|
22
|
+
* @since 1.6.0
|
|
23
|
+
*/
|
|
24
|
+
/**
|
|
22
25
|
* Implementation of the {@link KvStore} interface for Cloudflare Workers KV
|
|
23
26
|
* binding. This class provides a wrapper around Cloudflare's KV namespace to
|
|
24
27
|
* store and retrieve JSON-serializable values using structured keys.
|
|
@@ -36,8 +39,7 @@ import { getLogger } from "@logtape/logtape";
|
|
|
36
39
|
var WorkersKvStore = class {
|
|
37
40
|
#namespace;
|
|
38
41
|
constructor(namespace) {
|
|
39
|
-
|
|
40
|
-
logger.warn("The `@fedify/fedify/x/cfworkers` module is deprecated; use `WorkersKvStore` from `@fedify/cfworkers` package instead.");
|
|
42
|
+
getLogger(["fedify", "cfworkers"]).warn("The `@fedify/fedify/x/cfworkers` module is deprecated; use `WorkersKvStore` from `@fedify/cfworkers` package instead.");
|
|
41
43
|
this.#namespace = namespace;
|
|
42
44
|
}
|
|
43
45
|
#encodeKey(key) {
|
|
@@ -46,7 +48,9 @@ var WorkersKvStore = class {
|
|
|
46
48
|
async get(key) {
|
|
47
49
|
const encodedKey = this.#encodeKey(key);
|
|
48
50
|
const { value, metadata } = await this.#namespace.getWithMetadata(encodedKey, "json");
|
|
49
|
-
|
|
51
|
+
if (value == null) return void 0;
|
|
52
|
+
if (metadata?.expires != null && metadata.expires < Date.now()) return;
|
|
53
|
+
return value;
|
|
50
54
|
}
|
|
51
55
|
async set(key, value, options) {
|
|
52
56
|
const encodedKey = this.#encodeKey(key);
|
|
@@ -85,8 +89,7 @@ var WorkersMessageQueue = class {
|
|
|
85
89
|
*/
|
|
86
90
|
nativeRetrial = true;
|
|
87
91
|
constructor(queue) {
|
|
88
|
-
|
|
89
|
-
logger.warn("The `@fedify/fedify/x/cfworkers` module is deprecated; use `WorkersMessageQueue` from `@fedify/cfworkers` package instead.");
|
|
92
|
+
getLogger(["fedify", "cfworkers"]).warn("The `@fedify/fedify/x/cfworkers` module is deprecated; use `WorkersMessageQueue` from `@fedify/cfworkers` package instead.");
|
|
90
93
|
this.#queue = queue;
|
|
91
94
|
}
|
|
92
95
|
enqueue(message, options) {
|
|
@@ -106,7 +109,6 @@ var WorkersMessageQueue = class {
|
|
|
106
109
|
throw new TypeError("WorkersMessageQueue does not support listen(). Use Federation.processQueuedTask() method instead.");
|
|
107
110
|
}
|
|
108
111
|
};
|
|
109
|
-
|
|
110
112
|
//#endregion
|
|
111
113
|
//#region src/x/cfworkers.test.ts
|
|
112
114
|
test({
|
|
@@ -175,5 +177,5 @@ async function waitFor(predicate, timeoutMs) {
|
|
|
175
177
|
if (delayed > timeoutMs) throw new Error("Timeout");
|
|
176
178
|
}
|
|
177
179
|
}
|
|
178
|
-
|
|
179
|
-
|
|
180
|
+
//#endregion
|
|
181
|
+
export {};
|