@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
package/dist/runtime/mod.d.cts
CHANGED
|
@@ -1,6 +1,103 @@
|
|
|
1
|
-
import "../
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import "
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { a as FetchError, c as KvCacheParameters, d as getDocumentLoader, f as getUserAgent, i as DocumentLoaderFactoryOptions, l as RemoteDocument, n as DocumentLoader, o as GetDocumentLoaderOptions, p as kvCache, r as DocumentLoaderFactory, s as GetUserAgentOptions, t as AuthenticatedDocumentLoaderFactory, u as fetchDocumentLoader } from "../docloader-DpGRDZrn.cjs";
|
|
2
|
+
import { pt as LanguageString } from "../vocab-BLvSEtuz.cjs";
|
|
3
|
+
import { n as HttpMessageSignaturesSpecDeterminer } from "../http-C7WoprmE.cjs";
|
|
4
|
+
import { TracerProvider } from "@opentelemetry/api";
|
|
5
|
+
|
|
6
|
+
//#region src/runtime/authdocloader.d.ts
|
|
7
|
+
/**
|
|
8
|
+
* Options for {@link getAuthenticatedDocumentLoader}.
|
|
9
|
+
* @see {@link getAuthenticatedDocumentLoader}
|
|
10
|
+
* @since 1.3.0
|
|
11
|
+
*/
|
|
12
|
+
interface GetAuthenticatedDocumentLoaderOptions extends DocumentLoaderFactoryOptions {
|
|
13
|
+
/**
|
|
14
|
+
* An optional spec determiner for HTTP Message Signatures.
|
|
15
|
+
* It determines the spec to use for signing requests.
|
|
16
|
+
* It is used for double-knocking
|
|
17
|
+
* (see <https://swicg.github.io/activitypub-http-signature/#how-to-upgrade-supported-versions>).
|
|
18
|
+
* @since 1.6.0
|
|
19
|
+
*/
|
|
20
|
+
specDeterminer?: HttpMessageSignaturesSpecDeterminer;
|
|
21
|
+
/**
|
|
22
|
+
* The OpenTelemetry tracer provider. If omitted, the global tracer provider
|
|
23
|
+
* is used.
|
|
24
|
+
* @since 1.6.0
|
|
25
|
+
*/
|
|
26
|
+
tracerProvider?: TracerProvider;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Gets an authenticated {@link DocumentLoader} for the given identity.
|
|
30
|
+
* Note that an authenticated document loader intentionally does not cache
|
|
31
|
+
* the fetched documents.
|
|
32
|
+
* @param identity The identity to get the document loader for.
|
|
33
|
+
* The actor's key pair.
|
|
34
|
+
* @param options The options for the document loader.
|
|
35
|
+
* @returns The authenticated document loader.
|
|
36
|
+
* @throws {TypeError} If the key is invalid or unsupported.
|
|
37
|
+
* @since 0.4.0
|
|
38
|
+
*/
|
|
39
|
+
declare function getAuthenticatedDocumentLoader(identity: {
|
|
40
|
+
keyId: URL;
|
|
41
|
+
privateKey: CryptoKey;
|
|
42
|
+
}, {
|
|
43
|
+
allowPrivateAddress,
|
|
44
|
+
userAgent,
|
|
45
|
+
specDeterminer,
|
|
46
|
+
tracerProvider
|
|
47
|
+
}?: GetAuthenticatedDocumentLoaderOptions): DocumentLoader;
|
|
48
|
+
//#endregion
|
|
49
|
+
//#region src/runtime/key.d.ts
|
|
50
|
+
/**
|
|
51
|
+
* Imports a PEM-SPKI formatted public key.
|
|
52
|
+
* @param pem The PEM-SPKI formatted public key.
|
|
53
|
+
* @returns The imported public key.
|
|
54
|
+
* @throws {TypeError} If the key is invalid or unsupported.
|
|
55
|
+
* @since 0.5.0
|
|
56
|
+
*/
|
|
57
|
+
declare function importSpki(pem: string): Promise<CryptoKey>;
|
|
58
|
+
/**
|
|
59
|
+
* Exports a public key in PEM-SPKI format.
|
|
60
|
+
* @param key The public key to export.
|
|
61
|
+
* @returns The exported public key in PEM-SPKI format.
|
|
62
|
+
* @throws {TypeError} If the key is invalid or unsupported.
|
|
63
|
+
* @since 0.5.0
|
|
64
|
+
*/
|
|
65
|
+
declare function exportSpki(key: CryptoKey): Promise<string>;
|
|
66
|
+
/**
|
|
67
|
+
* Imports a PEM-PKCS#1 formatted public key.
|
|
68
|
+
* @param pem The PEM-PKCS#1 formatted public key.
|
|
69
|
+
* @returns The imported public key.
|
|
70
|
+
* @throws {TypeError} If the key is invalid or unsupported.
|
|
71
|
+
* @since 1.5.0
|
|
72
|
+
*/
|
|
73
|
+
declare function importPkcs1(pem: string): Promise<CryptoKey>;
|
|
74
|
+
/**
|
|
75
|
+
* Imports a PEM formatted public key (SPKI or PKCS#1).
|
|
76
|
+
* @param pem The PEM formatted public key to import (SPKI or PKCS#1).
|
|
77
|
+
* @returns The imported public key.
|
|
78
|
+
* @throws {TypeError} If the key is invalid or unsupported.
|
|
79
|
+
* @since 1.5.0
|
|
80
|
+
*/
|
|
81
|
+
declare function importPem(pem: string): Promise<CryptoKey>;
|
|
82
|
+
/**
|
|
83
|
+
* Imports a [Multibase]-encoded public key.
|
|
84
|
+
*
|
|
85
|
+
* [Multibase]: https://www.w3.org/TR/vc-data-integrity/#multibase-0
|
|
86
|
+
* @param key The Multibase-encoded public key.
|
|
87
|
+
* @returns The imported public key.
|
|
88
|
+
* @throws {TypeError} If the key is invalid or unsupported.
|
|
89
|
+
* @since 0.10.0
|
|
90
|
+
*/
|
|
91
|
+
declare function importMultibaseKey(key: string): Promise<CryptoKey>;
|
|
92
|
+
/**
|
|
93
|
+
* Exports a public key in [Multibase] format.
|
|
94
|
+
*
|
|
95
|
+
* [Multibase]: https://www.w3.org/TR/vc-data-integrity/#multibase-0
|
|
96
|
+
* @param key The public key to export.
|
|
97
|
+
* @returns The exported public key in Multibase format.
|
|
98
|
+
* @throws {TypeError} If the key is invalid or unsupported.
|
|
99
|
+
* @since 0.10.0
|
|
100
|
+
*/
|
|
101
|
+
declare function exportMultibaseKey(key: CryptoKey): Promise<string>;
|
|
102
|
+
//#endregion
|
|
103
|
+
export { type AuthenticatedDocumentLoaderFactory, type DocumentLoader, type DocumentLoaderFactory, type DocumentLoaderFactoryOptions, FetchError, GetAuthenticatedDocumentLoaderOptions, type GetDocumentLoaderOptions, type GetUserAgentOptions, type KvCacheParameters, LanguageString, type RemoteDocument, exportMultibaseKey, exportSpki, fetchDocumentLoader, getAuthenticatedDocumentLoader, getDocumentLoader, getUserAgent, importMultibaseKey, importPem, importPkcs1, importSpki, kvCache };
|
package/dist/runtime/mod.d.ts
CHANGED
|
@@ -1,8 +1,105 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
-
import "../
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import "
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
import { a as FetchError, c as KvCacheParameters, d as getDocumentLoader, f as getUserAgent, i as DocumentLoaderFactoryOptions, l as RemoteDocument, n as DocumentLoader, o as GetDocumentLoaderOptions, p as kvCache, r as DocumentLoaderFactory, s as GetUserAgentOptions, t as AuthenticatedDocumentLoaderFactory, u as fetchDocumentLoader } from "../docloader-DSaLRXEA.js";
|
|
4
|
+
import { pt as LanguageString } from "../vocab-lhCS9lzq.js";
|
|
5
|
+
import { n as HttpMessageSignaturesSpecDeterminer } from "../http-BZpls--H.js";
|
|
6
|
+
import { TracerProvider } from "@opentelemetry/api";
|
|
7
|
+
|
|
8
|
+
//#region src/runtime/authdocloader.d.ts
|
|
9
|
+
/**
|
|
10
|
+
* Options for {@link getAuthenticatedDocumentLoader}.
|
|
11
|
+
* @see {@link getAuthenticatedDocumentLoader}
|
|
12
|
+
* @since 1.3.0
|
|
13
|
+
*/
|
|
14
|
+
interface GetAuthenticatedDocumentLoaderOptions extends DocumentLoaderFactoryOptions {
|
|
15
|
+
/**
|
|
16
|
+
* An optional spec determiner for HTTP Message Signatures.
|
|
17
|
+
* It determines the spec to use for signing requests.
|
|
18
|
+
* It is used for double-knocking
|
|
19
|
+
* (see <https://swicg.github.io/activitypub-http-signature/#how-to-upgrade-supported-versions>).
|
|
20
|
+
* @since 1.6.0
|
|
21
|
+
*/
|
|
22
|
+
specDeterminer?: HttpMessageSignaturesSpecDeterminer;
|
|
23
|
+
/**
|
|
24
|
+
* The OpenTelemetry tracer provider. If omitted, the global tracer provider
|
|
25
|
+
* is used.
|
|
26
|
+
* @since 1.6.0
|
|
27
|
+
*/
|
|
28
|
+
tracerProvider?: TracerProvider;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Gets an authenticated {@link DocumentLoader} for the given identity.
|
|
32
|
+
* Note that an authenticated document loader intentionally does not cache
|
|
33
|
+
* the fetched documents.
|
|
34
|
+
* @param identity The identity to get the document loader for.
|
|
35
|
+
* The actor's key pair.
|
|
36
|
+
* @param options The options for the document loader.
|
|
37
|
+
* @returns The authenticated document loader.
|
|
38
|
+
* @throws {TypeError} If the key is invalid or unsupported.
|
|
39
|
+
* @since 0.4.0
|
|
40
|
+
*/
|
|
41
|
+
declare function getAuthenticatedDocumentLoader(identity: {
|
|
42
|
+
keyId: URL;
|
|
43
|
+
privateKey: CryptoKey;
|
|
44
|
+
}, {
|
|
45
|
+
allowPrivateAddress,
|
|
46
|
+
userAgent,
|
|
47
|
+
specDeterminer,
|
|
48
|
+
tracerProvider
|
|
49
|
+
}?: GetAuthenticatedDocumentLoaderOptions): DocumentLoader;
|
|
50
|
+
//#endregion
|
|
51
|
+
//#region src/runtime/key.d.ts
|
|
52
|
+
/**
|
|
53
|
+
* Imports a PEM-SPKI formatted public key.
|
|
54
|
+
* @param pem The PEM-SPKI formatted public key.
|
|
55
|
+
* @returns The imported public key.
|
|
56
|
+
* @throws {TypeError} If the key is invalid or unsupported.
|
|
57
|
+
* @since 0.5.0
|
|
58
|
+
*/
|
|
59
|
+
declare function importSpki(pem: string): Promise<CryptoKey>;
|
|
60
|
+
/**
|
|
61
|
+
* Exports a public key in PEM-SPKI format.
|
|
62
|
+
* @param key The public key to export.
|
|
63
|
+
* @returns The exported public key in PEM-SPKI format.
|
|
64
|
+
* @throws {TypeError} If the key is invalid or unsupported.
|
|
65
|
+
* @since 0.5.0
|
|
66
|
+
*/
|
|
67
|
+
declare function exportSpki(key: CryptoKey): Promise<string>;
|
|
68
|
+
/**
|
|
69
|
+
* Imports a PEM-PKCS#1 formatted public key.
|
|
70
|
+
* @param pem The PEM-PKCS#1 formatted public key.
|
|
71
|
+
* @returns The imported public key.
|
|
72
|
+
* @throws {TypeError} If the key is invalid or unsupported.
|
|
73
|
+
* @since 1.5.0
|
|
74
|
+
*/
|
|
75
|
+
declare function importPkcs1(pem: string): Promise<CryptoKey>;
|
|
76
|
+
/**
|
|
77
|
+
* Imports a PEM formatted public key (SPKI or PKCS#1).
|
|
78
|
+
* @param pem The PEM formatted public key to import (SPKI or PKCS#1).
|
|
79
|
+
* @returns The imported public key.
|
|
80
|
+
* @throws {TypeError} If the key is invalid or unsupported.
|
|
81
|
+
* @since 1.5.0
|
|
82
|
+
*/
|
|
83
|
+
declare function importPem(pem: string): Promise<CryptoKey>;
|
|
84
|
+
/**
|
|
85
|
+
* Imports a [Multibase]-encoded public key.
|
|
86
|
+
*
|
|
87
|
+
* [Multibase]: https://www.w3.org/TR/vc-data-integrity/#multibase-0
|
|
88
|
+
* @param key The Multibase-encoded public key.
|
|
89
|
+
* @returns The imported public key.
|
|
90
|
+
* @throws {TypeError} If the key is invalid or unsupported.
|
|
91
|
+
* @since 0.10.0
|
|
92
|
+
*/
|
|
93
|
+
declare function importMultibaseKey(key: string): Promise<CryptoKey>;
|
|
94
|
+
/**
|
|
95
|
+
* Exports a public key in [Multibase] format.
|
|
96
|
+
*
|
|
97
|
+
* [Multibase]: https://www.w3.org/TR/vc-data-integrity/#multibase-0
|
|
98
|
+
* @param key The public key to export.
|
|
99
|
+
* @returns The exported public key in Multibase format.
|
|
100
|
+
* @throws {TypeError} If the key is invalid or unsupported.
|
|
101
|
+
* @since 0.10.0
|
|
102
|
+
*/
|
|
103
|
+
declare function exportMultibaseKey(key: CryptoKey): Promise<string>;
|
|
104
|
+
//#endregion
|
|
105
|
+
export { type AuthenticatedDocumentLoaderFactory, type DocumentLoader, type DocumentLoaderFactory, type DocumentLoaderFactoryOptions, FetchError, GetAuthenticatedDocumentLoaderOptions, type GetDocumentLoaderOptions, type GetUserAgentOptions, type KvCacheParameters, LanguageString, type RemoteDocument, exportMultibaseKey, exportSpki, fetchDocumentLoader, getAuthenticatedDocumentLoader, getDocumentLoader, getUserAgent, importMultibaseKey, importPem, importPkcs1, importSpki, kvCache };
|
package/dist/runtime/mod.js
CHANGED
|
@@ -1,13 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
import "../lookup-CKZfuyxA.js";
|
|
8
|
-
import "../key-ibMO03_0.js";
|
|
9
|
-
import "../http-CR-Eg1Uq.js";
|
|
10
|
-
import { getAuthenticatedDocumentLoader } from "../authdocloader-DUQcOTRS.js";
|
|
11
|
-
import "../runtime-DPYEDf-o.js";
|
|
12
|
-
|
|
13
|
-
export { FetchError, LanguageString, exportMultibaseKey, exportSpki, fetchDocumentLoader, getAuthenticatedDocumentLoader, getDocumentLoader, getUserAgent, importMultibaseKey, importPem, importPkcs1, importSpki, kvCache };
|
|
1
|
+
import "@js-temporal/polyfill";
|
|
2
|
+
import "urlpattern-polyfill";
|
|
3
|
+
import { i as getDocumentLoader, o as getUserAgent, r as fetchDocumentLoader, s as kvCache, t as FetchError } from "../docloader-BoXhusJ1.js";
|
|
4
|
+
import { Ct as importPkcs1, St as importPem, bt as exportSpki, vt as LanguageString, wt as importSpki, xt as importMultibaseKey, yt as exportMultibaseKey } from "../actor-BTA45fXF.js";
|
|
5
|
+
import { t as getAuthenticatedDocumentLoader } from "../authdocloader-CqtNsX_N.js";
|
|
6
|
+
export { FetchError, LanguageString, exportMultibaseKey, exportSpki, fetchDocumentLoader, getAuthenticatedDocumentLoader, getDocumentLoader, getUserAgent, importMultibaseKey, importPem, importPkcs1, importSpki, kvCache };
|
|
@@ -1,20 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
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
|
-
|
|
1
|
+
import "@js-temporal/polyfill";
|
|
2
|
+
import "urlpattern-polyfill";
|
|
3
|
+
globalThis.addEventListener = () => {};
|
|
4
|
+
import { B as names, H as encodeText, L as decode, R as encode, V as decodeText, z as codes } 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";
|
|
18
8
|
//#region src/runtime/multibase/multibase.test.ts
|
|
19
9
|
test("multibase.encode and decode", async (t) => {
|
|
20
10
|
const testCases = [
|
|
@@ -330,29 +320,22 @@ test("multibase.encode and decode", async (t) => {
|
|
|
330
320
|
]
|
|
331
321
|
];
|
|
332
322
|
for (const [name, input, expectedOutput] of testCases) await t.step(`Encoding/Decoding ${name} with ${input}`, () => {
|
|
333
|
-
|
|
334
|
-
assertEquals(
|
|
335
|
-
|
|
336
|
-
assertEquals(decoded, encodeText(input), `Decoding ${name} failed`);
|
|
337
|
-
const decodedFromBuffer = decode(encodeText(expectedOutput));
|
|
338
|
-
assertEquals(decodedFromBuffer, encodeText(input), `Decoding buffer of ${name} failed`);
|
|
323
|
+
assertEquals(decodeText(encode(name, encodeText(input))), expectedOutput, `Encoding ${name} failed`);
|
|
324
|
+
assertEquals(decode(expectedOutput), encodeText(input), `Decoding ${name} failed`);
|
|
325
|
+
assertEquals(decode(encodeText(expectedOutput)), encodeText(input), `Decoding buffer of ${name} failed`);
|
|
339
326
|
});
|
|
340
327
|
await t.step("should allow base32pad full alphabet", () => {
|
|
341
|
-
const
|
|
342
|
-
|
|
343
|
-
const encoded = encode("c", decoded);
|
|
344
|
-
assertEquals(decode(encoded), decoded);
|
|
328
|
+
const decoded = decode("ctimaq4ygg2iegci7");
|
|
329
|
+
assertEquals(decode(encode("c", decoded)), decoded);
|
|
345
330
|
});
|
|
346
331
|
});
|
|
347
332
|
test("constants", async (t) => {
|
|
348
333
|
await t.step("constants indexed by name", () => {
|
|
349
|
-
|
|
350
|
-
assertEquals(Object.keys(names$1).length, 23);
|
|
334
|
+
assertEquals(Object.keys(names).length, 23);
|
|
351
335
|
});
|
|
352
336
|
await t.step("constants indexed by code", () => {
|
|
353
|
-
|
|
354
|
-
assertEquals(Object.keys(codes$1).length, 23);
|
|
337
|
+
assertEquals(Object.keys(codes).length, 23);
|
|
355
338
|
});
|
|
356
339
|
});
|
|
357
|
-
|
|
358
|
-
|
|
340
|
+
//#endregion
|
|
341
|
+
export {};
|
|
@@ -1,16 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { assert } from "../assert-
|
|
9
|
-
import "../lookup-BMAWLsP2.js";
|
|
10
|
-
import { test } from "../testing-RPOc_gVG.js";
|
|
11
|
-
import { assertFalse, assertRejects } from "../assert_rejects-DiIiJbZn.js";
|
|
12
|
-
import "../assert_is_error-BPGph1Jx.js";
|
|
13
|
-
|
|
1
|
+
import "@js-temporal/polyfill";
|
|
2
|
+
import "urlpattern-polyfill";
|
|
3
|
+
globalThis.addEventListener = () => {};
|
|
4
|
+
import { $ as UrlError, et as expandIPv6Address, nt as isValidPublicIPv6Address, rt as validatePublicUrl, tt as isValidPublicIPv4Address } 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 { n as assertFalse, t as assertRejects } from "../assert_rejects-CJC9ThS-.mjs";
|
|
8
|
+
import { t as assert } from "../assert-DikXweDx.mjs";
|
|
14
9
|
//#region src/runtime/url.test.ts
|
|
15
10
|
test("validatePublicUrl()", async () => {
|
|
16
11
|
await assertRejects(() => validatePublicUrl("ftp://localhost"), UrlError);
|
|
@@ -41,5 +36,5 @@ test("expandIPv6Address()", () => {
|
|
|
41
36
|
assertEquals(expandIPv6Address("2001:db8::"), "2001:0db8:0000:0000:0000:0000:0000:0000");
|
|
42
37
|
assertEquals(expandIPv6Address("2001:db8::1"), "2001:0db8:0000:0000:0000:0000:0000:0001");
|
|
43
38
|
});
|
|
44
|
-
|
|
45
|
-
|
|
39
|
+
//#endregion
|
|
40
|
+
export {};
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
globalThis.addEventListener = () => {};
|
|
5
|
-
|
|
1
|
+
import "@js-temporal/polyfill";
|
|
2
|
+
import "urlpattern-polyfill";
|
|
3
|
+
globalThis.addEventListener = () => {};
|
|
6
4
|
//#region src/nodeinfo/semver.ts
|
|
7
5
|
const MAX_LENGTH = 256;
|
|
8
6
|
/**
|
|
@@ -31,15 +29,10 @@ const PRERELEASE = `(?:-(?<prerelease>${PRERELEASE_IDENTIFIER}(?:\\.${PRERELEASE
|
|
|
31
29
|
*/
|
|
32
30
|
const BUILD_IDENTIFIER = "[0-9A-Za-z-]+";
|
|
33
31
|
/**
|
|
34
|
-
* A plus sign, followed by one or more period-separated build metadata identifiers.
|
|
35
|
-
* @example "+build.meta"
|
|
36
|
-
*/
|
|
37
|
-
const BUILD = `(?:\\+(?<buildmetadata>${BUILD_IDENTIFIER}(?:\\.${BUILD_IDENTIFIER})*))`;
|
|
38
|
-
/**
|
|
39
32
|
* A version, followed optionally by a pre-release version and build metadata.
|
|
40
33
|
*/
|
|
41
|
-
const FULL_VERSION = `v?${VERSION_CORE}${PRERELEASE}?${
|
|
42
|
-
const FULL_REGEXP =
|
|
34
|
+
const FULL_VERSION = `v?${VERSION_CORE}${PRERELEASE}?${`(?:\\+(?<buildmetadata>${BUILD_IDENTIFIER}(?:\\.${BUILD_IDENTIFIER})*))`}?`;
|
|
35
|
+
const FULL_REGEXP = new RegExp(`^${FULL_VERSION}$`);
|
|
43
36
|
/**
|
|
44
37
|
* Attempt to parse a string as a semantic version, returning a SemVer object.
|
|
45
38
|
*
|
|
@@ -69,17 +62,12 @@ function parseSemVer(value) {
|
|
|
69
62
|
value = value.trim();
|
|
70
63
|
const groups = value.match(FULL_REGEXP)?.groups;
|
|
71
64
|
if (!groups) throw new TypeError(`Cannot parse version: ${value}`);
|
|
72
|
-
const major = parseNumber(groups.major, `Cannot parse version ${value}: invalid major version`);
|
|
73
|
-
const minor = parseNumber(groups.minor, `Cannot parse version ${value}: invalid minor version`);
|
|
74
|
-
const patch = parseNumber(groups.patch, `Cannot parse version ${value}: invalid patch version`);
|
|
75
|
-
const prerelease = groups.prerelease ? parsePrerelease(groups.prerelease) : [];
|
|
76
|
-
const build = groups.buildmetadata ? parseBuild(groups.buildmetadata) : [];
|
|
77
65
|
return {
|
|
78
|
-
major,
|
|
79
|
-
minor,
|
|
80
|
-
patch,
|
|
81
|
-
prerelease,
|
|
82
|
-
build
|
|
66
|
+
major: parseNumber(groups.major, `Cannot parse version ${value}: invalid major version`),
|
|
67
|
+
minor: parseNumber(groups.minor, `Cannot parse version ${value}: invalid minor version`),
|
|
68
|
+
patch: parseNumber(groups.patch, `Cannot parse version ${value}: invalid patch version`),
|
|
69
|
+
prerelease: groups.prerelease ? parsePrerelease(groups.prerelease) : [],
|
|
70
|
+
build: groups.buildmetadata ? parseBuild(groups.buildmetadata) : []
|
|
83
71
|
};
|
|
84
72
|
}
|
|
85
73
|
/**
|
|
@@ -93,7 +81,7 @@ function parseSemVer(value) {
|
|
|
93
81
|
function isValidNumber(value) {
|
|
94
82
|
return typeof value === "number" && !Number.isNaN(value) && (!Number.isFinite(value) || 0 <= value && value <= Number.MAX_SAFE_INTEGER);
|
|
95
83
|
}
|
|
96
|
-
const NUMERIC_IDENTIFIER_REGEXP =
|
|
84
|
+
const NUMERIC_IDENTIFIER_REGEXP = new RegExp(`^${NUMERIC_IDENTIFIER}$`);
|
|
97
85
|
function parsePrerelease(prerelease) {
|
|
98
86
|
return prerelease.split(".").filter(Boolean).map((id) => {
|
|
99
87
|
if (NUMERIC_IDENTIFIER_REGEXP.test(id)) {
|
|
@@ -140,10 +128,7 @@ function formatSemVer(version) {
|
|
|
140
128
|
const patch = formatNumber(version.patch);
|
|
141
129
|
const pre = version.prerelease?.join(".") ?? "";
|
|
142
130
|
const build = version.build?.join(".") ?? "";
|
|
143
|
-
|
|
144
|
-
const release = [primary, pre].filter((v) => v).join("-");
|
|
145
|
-
return [release, build].filter((v) => v).join("+");
|
|
131
|
+
return [[`${major}.${minor}.${patch}`, pre].filter((v) => v).join("-"), build].filter((v) => v).join("+");
|
|
146
132
|
}
|
|
147
|
-
|
|
148
133
|
//#endregion
|
|
149
|
-
export {
|
|
134
|
+
export { parseSemVer as n, formatSemVer as t };
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import { deno_default } from "./type-COPv6pMi.js";
|
|
7
|
-
import { doubleKnock } from "./http-05HxN-lp.js";
|
|
1
|
+
import "@js-temporal/polyfill";
|
|
2
|
+
import "urlpattern-polyfill";
|
|
3
|
+
globalThis.addEventListener = () => {};
|
|
4
|
+
import { ot as name, st as version } from "./vocab-DuW9rL1h.mjs";
|
|
5
|
+
import { n as doubleKnock } from "./http-Bu5ZNlhZ.mjs";
|
|
8
6
|
import { getLogger } from "@logtape/logtape";
|
|
9
7
|
import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
|
|
10
|
-
|
|
11
8
|
//#region src/federation/send.ts
|
|
12
9
|
/**
|
|
13
10
|
* Extracts the inbox URLs from recipients.
|
|
@@ -44,8 +41,7 @@ function extractInboxes({ recipients, preferSharedInbox, excludeBaseUris }) {
|
|
|
44
41
|
*/
|
|
45
42
|
function sendActivity(options) {
|
|
46
43
|
const tracerProvider = options.tracerProvider ?? trace.getTracerProvider();
|
|
47
|
-
|
|
48
|
-
return tracer.startActiveSpan("activitypub.send_activity", {
|
|
44
|
+
return tracerProvider.getTracer(name, version).startActiveSpan("activitypub.send_activity", {
|
|
49
45
|
kind: SpanKind.CLIENT,
|
|
50
46
|
attributes: { "activitypub.shared_inbox": options.sharedInbox ?? false }
|
|
51
47
|
}, async (span) => {
|
|
@@ -123,6 +119,5 @@ async function sendActivityInternal({ activity, activityId, keys, inbox, headers
|
|
|
123
119
|
throw new Error(`Failed to send activity ${activityId} to ${inbox.href} (${response.status} ${response.statusText}):\n${error}`);
|
|
124
120
|
}
|
|
125
121
|
}
|
|
126
|
-
|
|
127
122
|
//#endregion
|
|
128
|
-
export {
|
|
123
|
+
export { sendActivity as n, extractInboxes as t };
|