@fedify/fedify 1.10.5 → 1.10.7
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-CjkHF7Cj.cjs → actor-BGIAXtRd.cjs} +3112 -4674
- package/dist/{actor-Ch9BTg3N.js → actor-C-_2S5Mn.mjs} +8 -15
- package/dist/{actor-CQdxP8N-.js → actor-Cujbx4Zv.js} +1205 -2768
- package/dist/{actor-eeONG_sv.d.ts → actor-DXwwgFeR.d.ts} +3 -3
- package/dist/{actor-D190nbTD.d.cts → actor-DxvGbmjm.d.cts} +3 -3
- 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-fR-Fqcpa.js → authdocloader-1Sk2bqFx.mjs} +9 -14
- package/dist/{authdocloader-COFZT9Wh.js → authdocloader-D4Y6iyTF.js} +8 -15
- package/dist/{authdocloader-zc5ibOmU.cjs → authdocloader-DQfruCir.cjs} +14 -22
- package/dist/{builder-YD0q32nG.js → builder-CZbrDRl7.mjs} +31 -40
- package/dist/{client-B3mQJNO7.d.ts → client-D7t26_op.d.ts} +2 -2
- package/dist/{client-BgCucCG7.js → client-Dyb8MI3u.mjs} +11 -15
- package/dist/{client-n6L4GtQL.d.cts → client-yc0Z0P6Y.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-Cr5DIxq_.d.ts → context-C6n2yrj0.d.ts} +33 -26
- package/dist/{context-WJoO0SQs.d.cts → context-PfghnHYj.d.cts} +33 -26
- package/dist/{denokv-D0nfNQ1x.js → denokv-NJPMXyK0.mjs} +22 -11
- package/dist/{docloader-BucCRHZI.d.ts → docloader-D7k5A9JP.d.ts} +2 -7
- package/dist/{docloader-ChxNLZAA.d.cts → docloader-DbM94pGY.d.cts} +2 -7
- package/dist/{docloader-BETPdM09.js → docloader-Dtaju6oI.js} +18 -156
- package/dist/{docloader-irBWMSOZ.cjs → docloader-Q3DfzuUi.cjs} +116 -220
- package/dist/{esm-iGH0sRsE.js → esm-DOJg552-.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} +29 -58
- 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} +12 -26
- 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 +245 -21
- package/dist/federation/mod.d.cts +4 -13
- package/dist/federation/mod.d.ts +4 -13
- package/dist/federation/mod.js +240 -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} +24 -34
- package/dist/{http-PgdBoDIj.js → http-BRwSVBn1.mjs} +16 -32
- package/dist/{http-DS9z_HzB.d.ts → http-BYXQvoZQ.d.ts} +5 -9
- package/dist/{http-C_1RU1U_.d.cts → http-CMzg-A9P.d.cts} +5 -9
- package/dist/{http-CQAqR_vx.cjs → http-DCrun8ql.cjs} +51 -68
- package/dist/{http-CxiIW4rD.js → http-DRnRwr3i.js} +17 -33
- package/dist/{inbox-DcDIqTbR.js → inbox-pD1nbb_5.mjs} +17 -25
- package/dist/key-Cmbps6xt.cjs +4 -0
- package/dist/{key-dNFkodH5.cjs → key-DEYIxAFs.cjs} +42 -50
- package/dist/key-DMO0TgTa.mjs +5 -0
- package/dist/{key-I-ibyaZH.js → key-DdL5Oc59.mjs} +12 -18
- package/dist/{key-Cg0kO4dA.js → key-vIzWPiil.js} +19 -19
- package/dist/{keycache-hSs_XFSb.js → keycache-BVR9f06Y.mjs} +6 -10
- package/dist/{keys-CElJez9H.js → keys-Co-0pK8a.mjs} +6 -10
- package/dist/{kv-DipCBaw2.d.ts → kv-C6UC8M9S.d.ts} +1 -1
- package/dist/{kv-BqEOXcZv.d.cts → kv-ClC9WJh5.d.cts} +1 -1
- package/dist/{kv-QzKcOQgP.js → kv-OuT2IU64.mjs} +6 -10
- package/dist/{ld-b16r91YS.js → ld-BFaDk5gX.mjs} +17 -31
- package/dist/{lookup-CySNcNcC.js → lookup-CMYXdjVH.mjs} +8 -17
- package/dist/{lookup-Bfq9Jpm0.cjs → lookup-CZGJqSjm.cjs} +16 -23
- package/dist/{lookup-CiSAeWJl.js → lookup-jlmCTRsO.js} +5 -11
- package/dist/middleware-BWlZ-wms.cjs +4 -0
- package/dist/{middleware-C5emnCh-.js → middleware-BXD5WJbj.mjs} +276 -321
- package/dist/{middleware-Dxo56yae.cjs → middleware-BhMQrJXH.cjs} +494 -547
- package/dist/{middleware-Bs4xDuXR.js → middleware-CmA2E9Bu.js} +349 -393
- package/dist/middleware-H3Ce7yn3.mjs +5 -0
- package/dist/{mod-D5rfgGFE.d.cts → mod-BQ3lrlXU.d.cts} +3 -3
- package/dist/{mod-Dz5Y15Uy.d.cts → mod-C72agZIN.d.cts} +4 -4
- package/dist/{mod-CxMBb_dd.d.cts → mod-CDbqB60V.d.cts} +2 -2
- package/dist/{mod-DS4kJskR.d.ts → mod-Lj0W1nnG.d.ts} +3 -3
- package/dist/{mod-BZfdiPBo.d.ts → mod-_HNKaczF.d.ts} +4 -4
- package/dist/{mod-ChbckRnC.d.ts → mod-lHd-Zdd_.d.ts} +2 -2
- 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/otel/exporter.test.d.mts +2 -0
- package/dist/otel/{exporter.test.js → exporter.test.mjs} +122 -180
- package/dist/otel/mod.cjs +16 -22
- package/dist/otel/mod.d.cts +2 -2
- package/dist/otel/mod.d.ts +2 -2
- package/dist/otel/mod.js +9 -16
- package/dist/{otel-Chy5T2Xh.js → otel-0v4Zy01l.mjs} +5 -10
- package/dist/{owner-AcrG3Xz1.d.cts → owner-0yNTyGMb.d.cts} +4 -4
- package/dist/{owner-Bs-sPbHX.js → owner-CNdS8zxf.mjs} +11 -16
- package/dist/{owner-8NMhXwJd.d.ts → owner-CPEbNpnZ.d.ts} +4 -4
- package/dist/{proof-SgRikE_Y.js → proof-Co7YmDpv.mjs} +20 -32
- package/dist/{proof-flD2DeA-.js → proof-DHPbi_Mx.js} +34 -60
- package/dist/{proof-BvQS195q.cjs → proof-DcPdtve2.cjs} +115 -140
- 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} +55 -77
- 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-C0gFHa2i.js → send-BRCWNcMa.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.js → owner.test.mjs} +23 -39
- 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-C1GIraJh.js → testing-BLIh1cXz.mjs} +27 -35
- package/dist/{transformers-BFT6d7J5.js → transformers-BV4OeK9o.js} +3 -7
- package/dist/{transformers-CoBS-oFG.cjs → transformers-CLtJ5H8o.cjs} +20 -25
- package/dist/{types-BgUCCngg.cjs → types-B34v-m2N.cjs} +45 -64
- package/dist/{types-BIgY6c-l.js → types-CAnkAQGM.mjs} +5 -9
- package/dist/{types-Bu-epI-z.js → types-CXZk86AG.js} +18 -36
- 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} +34 -51
- package/dist/vocab/mod.cjs +256 -16
- package/dist/vocab/mod.d.cts +3 -5
- package/dist/vocab/mod.d.ts +3 -5
- package/dist/vocab/mod.js +249 -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-BASuuzcJ.d.ts → vocab-DaT4UsJF.d.ts} +2 -2
- package/dist/{vocab-DPMmFPJ1.d.cts → vocab-DnlmNyXi.d.cts} +2 -2
- package/dist/{type-DUhon7qK.js → vocab-rT_94Pke.mjs} +1178 -2876
- 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-C15gGOh1.cjs +0 -266
- package/dist/federation-K-xsO03l.js +0 -248
- package/dist/key-Bnod5wJl.js +0 -10
- package/dist/key-C6swTX71.js +0 -10
- package/dist/key-_Uq8gkmM.cjs +0 -10
- package/dist/middleware-BWsOtDIF.cjs +0 -17
- package/dist/middleware-Bm4bJzjg.js +0 -26
- package/dist/middleware-BvODpE_U.js +0 -17
- package/dist/mod-C2tOeRkN.d.cts +0 -1
- package/dist/mod-CD7gfdq3.d.ts +0 -104
- package/dist/mod-CnULG6Aa.d.ts +0 -82
- package/dist/mod-FZd39qVq.d.cts +0 -1
- package/dist/mod-JUhOKMHj.d.cts +0 -102
- package/dist/mod-OQfb33eH.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/otel/exporter.test.d.ts +0 -3
- 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/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-5i6DEIi6.cjs +0 -294
- package/dist/vocab-CBavAdew.js +0 -258
- 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,24 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import "../
|
|
10
|
-
import {
|
|
11
|
-
import "../
|
|
12
|
-
import {
|
|
13
|
-
import "../
|
|
14
|
-
import { assertRejects } from "../assert_rejects-DiIiJbZn.js";
|
|
15
|
-
import "../assert_is_error-BPGph1Jx.js";
|
|
16
|
-
import "../assert_not_equals-f3m3epl3.js";
|
|
17
|
-
import { assertThrows } from "../assert_throws-BOO88avQ.js";
|
|
18
|
-
import { createTestTracerProvider } from "../otel-Chy5T2Xh.js";
|
|
19
|
-
import { esm_default } from "../esm-iGH0sRsE.js";
|
|
1
|
+
import { Temporal } from "@js-temporal/polyfill";
|
|
2
|
+
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
+
globalThis.addEventListener = () => {};
|
|
4
|
+
import { $ as UrlError, G as FetchError, J as getDocumentLoader, X as getUserAgent, Z as kvCache, at as preloadedContexts, st as version } from "../vocab-rT_94Pke.mjs";
|
|
5
|
+
import { a as mockDocumentLoader, t as test } from "../testing-BLIh1cXz.mjs";
|
|
6
|
+
import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
|
|
7
|
+
import "../std__assert-2v7gYiZp.mjs";
|
|
8
|
+
import { t as assertRejects } from "../assert_rejects-CJC9ThS-.mjs";
|
|
9
|
+
import { t as assertThrows } from "../assert_throws-BIL7gChy.mjs";
|
|
10
|
+
import { t as assert } from "../assert-DikXweDx.mjs";
|
|
11
|
+
import { t as MemoryKvStore } from "../kv-OuT2IU64.mjs";
|
|
12
|
+
import { t as esm_default } from "../esm-DOJg552-.mjs";
|
|
13
|
+
import { t as createTestTracerProvider } from "../otel-0v4Zy01l.mjs";
|
|
20
14
|
import process from "node:process";
|
|
21
|
-
|
|
22
15
|
//#region src/runtime/docloader.test.ts
|
|
23
16
|
test("new FetchError()", () => {
|
|
24
17
|
const e = new FetchError("https://example.com/", "An error message.");
|
|
@@ -235,7 +228,7 @@ test("getDocumentLoader()", async (t) => {
|
|
|
235
228
|
await assertRejects(() => fetchDocumentLoader("https://example.com/404"), FetchError, "HTTP 404: https://example.com/404");
|
|
236
229
|
});
|
|
237
230
|
await t.step("preloaded contexts", async () => {
|
|
238
|
-
for (const [url, document] of Object.entries(
|
|
231
|
+
for (const [url, document] of Object.entries(preloadedContexts)) assertEquals(await fetchDocumentLoader(url), {
|
|
239
232
|
contextUrl: null,
|
|
240
233
|
documentUrl: url,
|
|
241
234
|
document
|
|
@@ -290,10 +283,9 @@ test("getDocumentLoader()", async (t) => {
|
|
|
290
283
|
let redirectAttempts = 0;
|
|
291
284
|
esm_default.get("begin:https://example.com/too-many-redirects/", (cl) => {
|
|
292
285
|
redirectAttempts++;
|
|
293
|
-
const index = Number(cl.url.split("/").at(-1));
|
|
294
286
|
return {
|
|
295
287
|
status: 302,
|
|
296
|
-
headers: { Location: `https://example.com/too-many-redirects/${
|
|
288
|
+
headers: { Location: `https://example.com/too-many-redirects/${Number(cl.url.split("/").at(-1)) + 1}` }
|
|
297
289
|
};
|
|
298
290
|
});
|
|
299
291
|
await t.step("too many redirects", async () => {
|
|
@@ -371,12 +363,11 @@ test("kvCache()", async (t) => {
|
|
|
371
363
|
type: "Object"
|
|
372
364
|
}
|
|
373
365
|
});
|
|
374
|
-
|
|
366
|
+
assertEquals(await kv.get([
|
|
375
367
|
"_test",
|
|
376
368
|
"cached",
|
|
377
369
|
"https://example.com/object"
|
|
378
|
-
]);
|
|
379
|
-
assertEquals(cache, result);
|
|
370
|
+
]), result);
|
|
380
371
|
await kv.set([
|
|
381
372
|
"_test",
|
|
382
373
|
"cached",
|
|
@@ -386,8 +377,7 @@ test("kvCache()", async (t) => {
|
|
|
386
377
|
documentUrl: "https://example.org/",
|
|
387
378
|
document: { "id": "https://example.org/" }
|
|
388
379
|
});
|
|
389
|
-
|
|
390
|
-
assertEquals(result2, {
|
|
380
|
+
assertEquals(await loader("https://example.org/"), {
|
|
391
381
|
contextUrl: null,
|
|
392
382
|
documentUrl: "https://example.org/",
|
|
393
383
|
document: { "id": "https://example.org/" }
|
|
@@ -401,22 +391,19 @@ test("kvCache()", async (t) => {
|
|
|
401
391
|
documentUrl: "https://example.net/",
|
|
402
392
|
document: { "id": "https://example.net/" }
|
|
403
393
|
});
|
|
404
|
-
|
|
405
|
-
assertEquals(result3, {
|
|
394
|
+
assertEquals(await loader("https://example.net/"), {
|
|
406
395
|
contextUrl: null,
|
|
407
396
|
documentUrl: "https://example.net/",
|
|
408
397
|
document: { "id": "https://example.net/" }
|
|
409
398
|
});
|
|
410
399
|
});
|
|
411
400
|
await t.step("not cached", async () => {
|
|
412
|
-
|
|
401
|
+
assertEquals(await kvCache({
|
|
413
402
|
kv,
|
|
414
403
|
loader: mockDocumentLoader,
|
|
415
404
|
rules: [],
|
|
416
405
|
prefix: ["_test", "not cached"]
|
|
417
|
-
})
|
|
418
|
-
const result = await loader("https://example.com/object");
|
|
419
|
-
assertEquals(result, {
|
|
406
|
+
})("https://example.com/object"), {
|
|
420
407
|
contextUrl: null,
|
|
421
408
|
documentUrl: "https://example.com/object",
|
|
422
409
|
document: {
|
|
@@ -426,12 +413,11 @@ test("kvCache()", async (t) => {
|
|
|
426
413
|
type: "Object"
|
|
427
414
|
}
|
|
428
415
|
});
|
|
429
|
-
|
|
416
|
+
assertEquals(await kv.get([
|
|
430
417
|
"test2",
|
|
431
418
|
"not cached",
|
|
432
419
|
"https://example.com/object"
|
|
433
|
-
]);
|
|
434
|
-
assertEquals(cache, void 0);
|
|
420
|
+
]), void 0);
|
|
435
421
|
});
|
|
436
422
|
await t.step("maximum cache duration", () => {
|
|
437
423
|
assertThrows(() => kvCache({
|
|
@@ -463,7 +449,7 @@ test("kvCache()", async (t) => {
|
|
|
463
449
|
throw new Error("Failed to delete key");
|
|
464
450
|
}
|
|
465
451
|
}
|
|
466
|
-
|
|
452
|
+
assertEquals(await kvCache({
|
|
467
453
|
kv: new KvStoreThrowsException(),
|
|
468
454
|
loader: mockDocumentLoader,
|
|
469
455
|
rules: [
|
|
@@ -472,9 +458,7 @@ test("kvCache()", async (t) => {
|
|
|
472
458
|
[new URLPattern("https://example.com/*"), Temporal.Duration.from({ days: 30 })]
|
|
473
459
|
],
|
|
474
460
|
prefix: ["_test", "not cached"]
|
|
475
|
-
})
|
|
476
|
-
const result = await loader("https://example.com/object");
|
|
477
|
-
assertEquals(result, {
|
|
461
|
+
})("https://example.com/object"), {
|
|
478
462
|
contextUrl: null,
|
|
479
463
|
documentUrl: "https://example.com/object",
|
|
480
464
|
document: {
|
|
@@ -486,7 +470,7 @@ test("kvCache()", async (t) => {
|
|
|
486
470
|
});
|
|
487
471
|
});
|
|
488
472
|
await t.step("preloaded contexts bypass cache", async () => {
|
|
489
|
-
const kv
|
|
473
|
+
const kv = new MemoryKvStore();
|
|
490
474
|
let loaderCalled = false;
|
|
491
475
|
const mockLoader = (url) => {
|
|
492
476
|
loaderCalled = true;
|
|
@@ -497,32 +481,29 @@ test("kvCache()", async (t) => {
|
|
|
497
481
|
});
|
|
498
482
|
};
|
|
499
483
|
const loader = kvCache({
|
|
500
|
-
kv
|
|
484
|
+
kv,
|
|
501
485
|
loader: mockLoader,
|
|
502
486
|
prefix: ["_test", "preloaded"]
|
|
503
487
|
});
|
|
504
488
|
const activityStreamsUrl = "https://www.w3.org/ns/activitystreams";
|
|
505
489
|
loaderCalled = false;
|
|
506
|
-
|
|
507
|
-
assertEquals(result, {
|
|
490
|
+
assertEquals(await loader(activityStreamsUrl), {
|
|
508
491
|
contextUrl: null,
|
|
509
492
|
documentUrl: activityStreamsUrl,
|
|
510
|
-
document:
|
|
493
|
+
document: preloadedContexts[activityStreamsUrl]
|
|
511
494
|
});
|
|
512
495
|
assertEquals(loaderCalled, false, "Loader should not be called for preloaded contexts");
|
|
513
|
-
|
|
496
|
+
assertEquals(await kv.get([
|
|
514
497
|
"_test",
|
|
515
498
|
"preloaded",
|
|
516
499
|
activityStreamsUrl
|
|
517
|
-
]);
|
|
518
|
-
assertEquals(cachedValue, void 0, "Preloaded contexts should not be cached in KV store");
|
|
500
|
+
]), void 0, "Preloaded contexts should not be cached in KV store");
|
|
519
501
|
const securityUrl = "https://w3id.org/security/v1";
|
|
520
502
|
loaderCalled = false;
|
|
521
|
-
|
|
522
|
-
assertEquals(result2, {
|
|
503
|
+
assertEquals(await loader(securityUrl), {
|
|
523
504
|
contextUrl: null,
|
|
524
505
|
documentUrl: securityUrl,
|
|
525
|
-
document:
|
|
506
|
+
document: preloadedContexts[securityUrl]
|
|
526
507
|
});
|
|
527
508
|
assertEquals(loaderCalled, false, "Loader should not be called for preloaded contexts");
|
|
528
509
|
const nonPreloadedUrl = "https://example.com/not-preloaded";
|
|
@@ -534,47 +515,46 @@ test("kvCache()", async (t) => {
|
|
|
534
515
|
document: { "mock": "document" }
|
|
535
516
|
});
|
|
536
517
|
assertEquals(loaderCalled, true, "Loader should be called for non-preloaded URLs");
|
|
537
|
-
|
|
518
|
+
assertEquals(await kv.get([
|
|
538
519
|
"_test",
|
|
539
520
|
"preloaded",
|
|
540
521
|
nonPreloadedUrl
|
|
541
|
-
]);
|
|
542
|
-
assertEquals(cachedValue2, result3, "Non-preloaded URLs should be cached");
|
|
522
|
+
]), result3, "Non-preloaded URLs should be cached");
|
|
543
523
|
});
|
|
544
524
|
});
|
|
545
525
|
test("getUserAgent()", () => {
|
|
546
526
|
if ("Deno" in globalThis) {
|
|
547
|
-
assertEquals(getUserAgent(), `Fedify/${
|
|
548
|
-
assertEquals(getUserAgent({ software: "MyApp/1.0.0" }), `MyApp/1.0.0 (Fedify/${
|
|
549
|
-
assertEquals(getUserAgent({ url: "https://example.com/" }), `Fedify/${
|
|
527
|
+
assertEquals(getUserAgent(), `Fedify/${version} (Deno/${Deno.version.deno})`);
|
|
528
|
+
assertEquals(getUserAgent({ software: "MyApp/1.0.0" }), `MyApp/1.0.0 (Fedify/${version}; Deno/${Deno.version.deno})`);
|
|
529
|
+
assertEquals(getUserAgent({ url: "https://example.com/" }), `Fedify/${version} (Deno/${Deno.version.deno}; +https://example.com/)`);
|
|
550
530
|
assertEquals(getUserAgent({
|
|
551
531
|
software: "MyApp/1.0.0",
|
|
552
532
|
url: new URL("https://example.com/")
|
|
553
|
-
}), `MyApp/1.0.0 (Fedify/${
|
|
533
|
+
}), `MyApp/1.0.0 (Fedify/${version}; Deno/${Deno.version.deno}; +https://example.com/)`);
|
|
554
534
|
} else if ("Bun" in globalThis) {
|
|
555
|
-
assertEquals(getUserAgent(), `Fedify/${
|
|
556
|
-
assertEquals(getUserAgent({ software: "MyApp/1.0.0" }), `MyApp/1.0.0 (Fedify/${
|
|
557
|
-
assertEquals(getUserAgent({ url: "https://example.com/" }), `Fedify/${
|
|
535
|
+
assertEquals(getUserAgent(), `Fedify/${version} (Bun/${Bun.version})`);
|
|
536
|
+
assertEquals(getUserAgent({ software: "MyApp/1.0.0" }), `MyApp/1.0.0 (Fedify/${version}; Bun/${Bun.version})`);
|
|
537
|
+
assertEquals(getUserAgent({ url: "https://example.com/" }), `Fedify/${version} (Bun/${Bun.version}; +https://example.com/)`);
|
|
558
538
|
assertEquals(getUserAgent({
|
|
559
539
|
software: "MyApp/1.0.0",
|
|
560
540
|
url: new URL("https://example.com/")
|
|
561
|
-
}), `MyApp/1.0.0 (Fedify/${
|
|
541
|
+
}), `MyApp/1.0.0 (Fedify/${version}; Bun/${Bun.version}; +https://example.com/)`);
|
|
562
542
|
} else if (navigator.userAgent === "Cloudflare-Workers") {
|
|
563
|
-
assertEquals(getUserAgent(), `Fedify/${
|
|
564
|
-
assertEquals(getUserAgent({ software: "MyApp/1.0.0" }), `MyApp/1.0.0 (Fedify/${
|
|
565
|
-
assertEquals(getUserAgent({ url: "https://example.com/" }), `Fedify/${
|
|
543
|
+
assertEquals(getUserAgent(), `Fedify/${version} (Cloudflare-Workers)`);
|
|
544
|
+
assertEquals(getUserAgent({ software: "MyApp/1.0.0" }), `MyApp/1.0.0 (Fedify/${version}; Cloudflare-Workers)`);
|
|
545
|
+
assertEquals(getUserAgent({ url: "https://example.com/" }), `Fedify/${version} (Cloudflare-Workers; +https://example.com/)`);
|
|
566
546
|
assertEquals(getUserAgent({
|
|
567
547
|
software: "MyApp/1.0.0",
|
|
568
548
|
url: new URL("https://example.com/")
|
|
569
|
-
}), `MyApp/1.0.0 (Fedify/${
|
|
549
|
+
}), `MyApp/1.0.0 (Fedify/${version}; Cloudflare-Workers; +https://example.com/)`);
|
|
570
550
|
} else {
|
|
571
|
-
assertEquals(getUserAgent(), `Fedify/${
|
|
572
|
-
assertEquals(getUserAgent({ software: "MyApp/1.0.0" }), `MyApp/1.0.0 (Fedify/${
|
|
573
|
-
assertEquals(getUserAgent({ url: "https://example.com/" }), `Fedify/${
|
|
551
|
+
assertEquals(getUserAgent(), `Fedify/${version} (Node.js/${process.versions.node})`);
|
|
552
|
+
assertEquals(getUserAgent({ software: "MyApp/1.0.0" }), `MyApp/1.0.0 (Fedify/${version}; Node.js/${process.versions.node})`);
|
|
553
|
+
assertEquals(getUserAgent({ url: "https://example.com/" }), `Fedify/${version} (Node.js/${process.versions.node}; +https://example.com/)`);
|
|
574
554
|
assertEquals(getUserAgent({
|
|
575
555
|
software: "MyApp/1.0.0",
|
|
576
556
|
url: new URL("https://example.com/")
|
|
577
|
-
}), `MyApp/1.0.0 (Fedify/${
|
|
557
|
+
}), `MyApp/1.0.0 (Fedify/${version}; Node.js/${process.versions.node}; +https://example.com/)`);
|
|
578
558
|
}
|
|
579
559
|
});
|
|
580
560
|
test("getDocumentLoader() records OpenTelemetry span", async (t) => {
|
|
@@ -594,8 +574,7 @@ test("getDocumentLoader() records OpenTelemetry span", async (t) => {
|
|
|
594
574
|
const originalProvider = trace.getTracerProvider();
|
|
595
575
|
trace.setGlobalTracerProvider(tracerProvider);
|
|
596
576
|
try {
|
|
597
|
-
|
|
598
|
-
assertEquals(result.documentUrl, "https://example.com/doc");
|
|
577
|
+
assertEquals((await loader("https://example.com/doc")).documentUrl, "https://example.com/doc");
|
|
599
578
|
const spans = exporter.getSpans("activitypub.fetch_document");
|
|
600
579
|
assertEquals(spans.length, 1);
|
|
601
580
|
const span = spans[0];
|
|
@@ -627,8 +606,7 @@ test("getDocumentLoader() records OpenTelemetry span", async (t) => {
|
|
|
627
606
|
const originalProvider = trace.getTracerProvider();
|
|
628
607
|
trace.setGlobalTracerProvider(tracerProvider);
|
|
629
608
|
try {
|
|
630
|
-
|
|
631
|
-
assertEquals(result.documentUrl, "https://example.com/new-doc");
|
|
609
|
+
assertEquals((await loader("https://example.com/doc")).documentUrl, "https://example.com/new-doc");
|
|
632
610
|
const spans = exporter.getSpans("activitypub.fetch_document");
|
|
633
611
|
assertEquals(spans.length, 2);
|
|
634
612
|
const redirectSpan = spans[spans.length - 1];
|
|
@@ -642,5 +620,5 @@ test("getDocumentLoader() records OpenTelemetry span", async (t) => {
|
|
|
642
620
|
}
|
|
643
621
|
});
|
|
644
622
|
});
|
|
645
|
-
|
|
646
|
-
|
|
623
|
+
//#endregion
|
|
624
|
+
export {};
|
|
@@ -1,22 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import "../
|
|
9
|
-
import "../assert_instance_of-DHz7EHNU.js";
|
|
10
|
-
import "../lookup-CySNcNcC.js";
|
|
11
|
-
import "../actor-Ch9BTg3N.js";
|
|
12
|
-
import { exportJwk, importJwk } from "../key-Cg0kO4dA.js";
|
|
13
|
-
import { test } from "../testing-C1GIraJh.js";
|
|
14
|
-
import "../std__assert-X-_kMxKM.js";
|
|
15
|
-
import "../assert_rejects-DiIiJbZn.js";
|
|
16
|
-
import "../assert_is_error-BPGph1Jx.js";
|
|
17
|
-
import "../assert_not_equals-f3m3epl3.js";
|
|
18
|
-
import "../assert_throws-BOO88avQ.js";
|
|
19
|
-
|
|
1
|
+
import "@js-temporal/polyfill";
|
|
2
|
+
import "urlpattern-polyfill";
|
|
3
|
+
globalThis.addEventListener = () => {};
|
|
4
|
+
import { F as importPkcs1, I as importSpki, M as exportSpki, N as importMultibaseKey, P as importPem, j as exportMultibaseKey } from "../vocab-rT_94Pke.mjs";
|
|
5
|
+
import { t as test } from "../testing-BLIh1cXz.mjs";
|
|
6
|
+
import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
|
|
7
|
+
import "../std__assert-2v7gYiZp.mjs";
|
|
8
|
+
import { i as importJwk, t as exportJwk } from "../key-DdL5Oc59.mjs";
|
|
20
9
|
//#region src/runtime/key.test.ts
|
|
21
10
|
const rsaSpki = "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxsRuvCkgJtflBTl4OVsm\nnt/J1mQfZasfJtN33dcZ3d1lJroxmgmMu69zjGEAwkNbMQaWNLqC4eogkJaeJ4RR\n5MHYXkL9nNilVoTkjX5BVit3puzs7XJ7WQnKQgQMI+ezn24GHsZ/v1JIo77lerX5\nk4HNwTNVt+yaZVQWaOMR3+6FwziQR6kd0VuG9/a9dgAnz2cEoORRC1i4W7IZaB1s\nZnh1WbHbevlGd72HSXll5rocPIHn8gq6xpBgpHwRphlRsgn4KHaJ6brXDIJjrnQh\nIe/YUBOGj/ImSEXhRwlFerKsoAVnZ0Hwbfa46qk44TAt8CyoPMWmpK6pt0ng4pQ2\nuwIDAQAB\n-----END PUBLIC KEY-----\n";
|
|
22
11
|
const rsaPkcs1 = "-----BEGIN RSA PUBLIC KEY-----\nMIIBCgKCAQEAxsRuvCkgJtflBTl4OVsmnt/J1mQfZasfJtN33dcZ3d1lJroxmgmM\nu69zjGEAwkNbMQaWNLqC4eogkJaeJ4RR5MHYXkL9nNilVoTkjX5BVit3puzs7XJ7\nWQnKQgQMI+ezn24GHsZ/v1JIo77lerX5k4HNwTNVt+yaZVQWaOMR3+6FwziQR6kd\n0VuG9/a9dgAnz2cEoORRC1i4W7IZaB1sZnh1WbHbevlGd72HSXll5rocPIHn8gq6\nxpBgpHwRphlRsgn4KHaJ6brXDIJjrnQhIe/YUBOGj/ImSEXhRwlFerKsoAVnZ0Hw\nbfa46qk44TAt8CyoPMWmpK6pt0ng4pQ2uwIDAQAB\n-----END RSA PUBLIC KEY-----\n";
|
|
@@ -40,64 +29,45 @@ const ed25519Jwk = {
|
|
|
40
29
|
};
|
|
41
30
|
const ed25519Multibase = "z6MksHj1MJnidCtDiyYW9ugNFftoX9fLK4bornTxmMZ6X7vq";
|
|
42
31
|
test("importSpki()", async () => {
|
|
43
|
-
|
|
44
|
-
assertEquals(await exportJwk(
|
|
45
|
-
const ed25519Key = await importSpki(ed25519Pem);
|
|
46
|
-
assertEquals(await exportJwk(ed25519Key), ed25519Jwk);
|
|
32
|
+
assertEquals(await exportJwk(await importSpki(rsaSpki)), rsaJwk);
|
|
33
|
+
assertEquals(await exportJwk(await importSpki(ed25519Pem)), ed25519Jwk);
|
|
47
34
|
});
|
|
48
35
|
test("exportSpki()", async () => {
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
assertEquals(
|
|
52
|
-
const ed25519Key = await importJwk(ed25519Jwk, "public");
|
|
53
|
-
const ed25519Spki = await exportSpki(ed25519Key);
|
|
54
|
-
assertEquals(ed25519Spki, ed25519Pem);
|
|
36
|
+
const rsaSpki = await exportSpki(await importJwk(rsaJwk, "public"));
|
|
37
|
+
assertEquals(rsaSpki, rsaSpki);
|
|
38
|
+
assertEquals(await exportSpki(await importJwk(ed25519Jwk, "public")), ed25519Pem);
|
|
55
39
|
});
|
|
56
40
|
test("importPkcs1()", async () => {
|
|
57
|
-
|
|
58
|
-
assertEquals(await exportJwk(rsaKey), rsaJwk);
|
|
41
|
+
assertEquals(await exportJwk(await importPkcs1(rsaPkcs1)), rsaJwk);
|
|
59
42
|
});
|
|
60
43
|
test("importPem()", async () => {
|
|
61
|
-
|
|
62
|
-
assertEquals(await exportJwk(
|
|
63
|
-
|
|
64
|
-
assertEquals(await exportJwk(rsaSpkiKey), rsaJwk);
|
|
65
|
-
const ed25519Key = await importPem(ed25519Pem);
|
|
66
|
-
assertEquals(await exportJwk(ed25519Key), ed25519Jwk);
|
|
44
|
+
assertEquals(await exportJwk(await importPem(rsaPkcs1)), rsaJwk);
|
|
45
|
+
assertEquals(await exportJwk(await importPem(rsaSpki)), rsaJwk);
|
|
46
|
+
assertEquals(await exportJwk(await importPem(ed25519Pem)), ed25519Jwk);
|
|
67
47
|
});
|
|
68
48
|
test("importMultibase()", async () => {
|
|
69
|
-
|
|
70
|
-
assertEquals(await exportJwk(
|
|
71
|
-
const ed25519Key = await importMultibaseKey(ed25519Multibase);
|
|
72
|
-
assertEquals(await exportJwk(ed25519Key), ed25519Jwk);
|
|
49
|
+
assertEquals(await exportJwk(await importMultibaseKey(rsaMultibase)), rsaJwk);
|
|
50
|
+
assertEquals(await exportJwk(await importMultibaseKey(ed25519Multibase)), ed25519Jwk);
|
|
73
51
|
});
|
|
74
52
|
test("exportMultibaseKey()", async () => {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
assertEquals(
|
|
78
|
-
const ed25519Key = await importJwk(ed25519Jwk, "public");
|
|
79
|
-
const ed25519Mb = await exportMultibaseKey(ed25519Key);
|
|
80
|
-
assertEquals(ed25519Mb, ed25519Multibase);
|
|
81
|
-
const rsaKey2 = await importJwk({
|
|
53
|
+
assertEquals(await exportMultibaseKey(await importJwk(rsaJwk, "public")), rsaMultibase);
|
|
54
|
+
assertEquals(await exportMultibaseKey(await importJwk(ed25519Jwk, "public")), ed25519Multibase);
|
|
55
|
+
assertEquals(await exportMultibaseKey(await importJwk({
|
|
82
56
|
alg: "RS256",
|
|
83
57
|
ext: true,
|
|
84
58
|
key_ops: ["verify"],
|
|
85
59
|
e: "AQAB",
|
|
86
60
|
kty: "RSA",
|
|
87
61
|
n: "sbX82NTV6IylxCh7MfV4hlyvaniCajuP97GyOqSvTmoEdBOflFvZ06kR_9D6ctt45Fk6hskfnag2GG69NALVH2o4RCR6tQiLRpKcMRtDYE_thEmfBvDzm_VVkOIYfxu-Ipuo9J_S5XDNDjczx2v-3oDh5-CIHkU46hvFeCvpUS-L8TJSbgX0kjVk_m4eIb9wh63rtmD6Uz_KBtCo5mmR4TEtcLZKYdqMp3wCjN-TlgHiz_4oVXWbHUefCEe8rFnX1iQnpDHU49_SaXQoud1jCaexFn25n-Aa8f8bc5Vm-5SeRwidHa6ErvEhTvf1dz6GoNPp2iRvm-wJ1gxwWJEYPQ"
|
|
88
|
-
}, "public");
|
|
89
|
-
|
|
90
|
-
assertEquals(rsaMb2, "z4MXj1wBzi9jUstyPMS4jQqB6KdJaiatPkAtVtGc6bQEQEEsKTic4G7Rou3iBf9vPmT5dbkm9qsZsuVNjq8HCuW1w24nhBFGkRE4cd2Uf2tfrB3N7h4mnyPp1BF3ZttHTYv3DLUPi1zMdkULiow3M1GfXkoC6DoxDUm1jmN6GBj22SjVsr6dxezRVQc7aj9TxE7JLbMH1wh5X3kA58H3DFW8rnYMakFGbca5CB2Jf6CnGQZmL7o5uJAdTwXfy2iiiyPxXEGerMhHwhjTA1mKYobyk2CpeEcmvynADfNZ5MBvcCS7m3XkFCMNUYBS9NQ3fze6vMSUPsNa6GVYmKx2x6JrdEjCk3qRMMmyjnjCMfR4pXbRMZa3i");
|
|
91
|
-
const ed25519Key2 = await importJwk({
|
|
62
|
+
}, "public")), "z4MXj1wBzi9jUstyPMS4jQqB6KdJaiatPkAtVtGc6bQEQEEsKTic4G7Rou3iBf9vPmT5dbkm9qsZsuVNjq8HCuW1w24nhBFGkRE4cd2Uf2tfrB3N7h4mnyPp1BF3ZttHTYv3DLUPi1zMdkULiow3M1GfXkoC6DoxDUm1jmN6GBj22SjVsr6dxezRVQc7aj9TxE7JLbMH1wh5X3kA58H3DFW8rnYMakFGbca5CB2Jf6CnGQZmL7o5uJAdTwXfy2iiiyPxXEGerMhHwhjTA1mKYobyk2CpeEcmvynADfNZ5MBvcCS7m3XkFCMNUYBS9NQ3fze6vMSUPsNa6GVYmKx2x6JrdEjCk3qRMMmyjnjCMfR4pXbRMZa3i");
|
|
63
|
+
assertEquals(await exportMultibaseKey(await importJwk({
|
|
92
64
|
alg: "Ed25519",
|
|
93
65
|
crv: "Ed25519",
|
|
94
66
|
ext: true,
|
|
95
67
|
key_ops: ["verify"],
|
|
96
68
|
kty: "OKP",
|
|
97
69
|
x: "Lm_M42cB3HkUiODQsXRcweM6TByfzEHGO9ND274JcOY"
|
|
98
|
-
}, "public");
|
|
99
|
-
const ed25519Mb2 = await exportMultibaseKey(ed25519Key2);
|
|
100
|
-
assertEquals(ed25519Mb2, "z6MkhaXgBZDvotDkL5257faiztiGiC2QtKLGpbnnEGta2doK");
|
|
70
|
+
}, "public")), "z6MkhaXgBZDvotDkL5257faiztiGiC2QtKLGpbnnEGta2doK");
|
|
101
71
|
});
|
|
102
|
-
|
|
103
|
-
|
|
72
|
+
//#endregion
|
|
73
|
+
export {};
|
|
@@ -1,22 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import "../assert-MZs1qjMx.js";
|
|
9
|
-
import "../assert_instance_of-DHz7EHNU.js";
|
|
10
|
-
import "../lookup-CySNcNcC.js";
|
|
11
|
-
import { test } from "../testing-C1GIraJh.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";
|
|
1
|
+
import "@js-temporal/polyfill";
|
|
2
|
+
import "urlpattern-polyfill";
|
|
3
|
+
globalThis.addEventListener = () => {};
|
|
4
|
+
import { A as LanguageString } from "../vocab-rT_94Pke.mjs";
|
|
5
|
+
import { t as test } from "../testing-BLIh1cXz.mjs";
|
|
6
|
+
import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
|
|
7
|
+
import "../std__assert-2v7gYiZp.mjs";
|
|
17
8
|
import { parseLanguageTag } from "@phensley/language-tag";
|
|
18
9
|
import util from "node:util";
|
|
19
|
-
|
|
20
10
|
//#region src/runtime/langstr.test.ts
|
|
21
11
|
test("new LanguageString()", () => {
|
|
22
12
|
const langStr = new LanguageString("Hello", "en");
|
|
@@ -36,5 +26,5 @@ test("util.inspect(LanguageString)", () => {
|
|
|
36
26
|
const langStr = new LanguageString("Hello, 'world'", "en");
|
|
37
27
|
assertEquals(util.inspect(langStr, { colors: false }), "<en> \"Hello, 'world'\"");
|
|
38
28
|
});
|
|
39
|
-
|
|
40
|
-
|
|
29
|
+
//#endregion
|
|
30
|
+
export {};
|
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import { HttpHeaderLink } from "../type-DUhon7qK.js";
|
|
7
|
-
import "../lookup-CySNcNcC.js";
|
|
8
|
-
import { test } from "../testing-C1GIraJh.js";
|
|
1
|
+
import "@js-temporal/polyfill";
|
|
2
|
+
import "urlpattern-polyfill";
|
|
3
|
+
globalThis.addEventListener = () => {};
|
|
4
|
+
import { it as HttpHeaderLink } from "../vocab-rT_94Pke.mjs";
|
|
5
|
+
import { t as test } from "../testing-BLIh1cXz.mjs";
|
|
9
6
|
import { deepStrictEqual, throws } from "node:assert";
|
|
10
|
-
|
|
11
7
|
//#region src/runtime/link.test.ts
|
|
12
8
|
test("String Good 1", () => {
|
|
13
9
|
const instance = new HttpHeaderLink(`<https://example.com>; rel="preconnect"`);
|
|
@@ -57,5 +53,5 @@ test("String Bad 1", () => {
|
|
|
57
53
|
new HttpHeaderLink(`https://bad.example; rel="preconnect"`);
|
|
58
54
|
});
|
|
59
55
|
});
|
|
60
|
-
|
|
61
|
-
|
|
56
|
+
//#endregion
|
|
57
|
+
export {};
|
package/dist/runtime/mod.cjs
CHANGED
|
@@ -1,15 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
require('../lookup-Bfq9Jpm0.cjs');
|
|
8
|
-
require('../key-dNFkodH5.cjs');
|
|
9
|
-
require('../http-CQAqR_vx.cjs');
|
|
10
|
-
const require_authdocloader = require('../authdocloader-zc5ibOmU.cjs');
|
|
11
|
-
require('../runtime-C58AJWSv.cjs');
|
|
12
|
-
|
|
1
|
+
const { Temporal } = require("@js-temporal/polyfill");
|
|
2
|
+
const { URLPattern } = require("urlpattern-polyfill");
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
+
const require_docloader = require("../docloader-Q3DfzuUi.cjs");
|
|
5
|
+
const require_actor = require("../actor-BGIAXtRd.cjs");
|
|
6
|
+
const require_authdocloader = require("../authdocloader-DQfruCir.cjs");
|
|
13
7
|
exports.FetchError = require_docloader.FetchError;
|
|
14
8
|
exports.LanguageString = require_actor.LanguageString;
|
|
15
9
|
exports.exportMultibaseKey = require_actor.exportMultibaseKey;
|
|
@@ -22,4 +16,4 @@ exports.importMultibaseKey = require_actor.importMultibaseKey;
|
|
|
22
16
|
exports.importPem = require_actor.importPem;
|
|
23
17
|
exports.importPkcs1 = require_actor.importPkcs1;
|
|
24
18
|
exports.importSpki = require_actor.importSpki;
|
|
25
|
-
exports.kvCache = require_docloader.kvCache;
|
|
19
|
+
exports.kvCache = require_docloader.kvCache;
|
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-DbM94pGY.cjs";
|
|
2
|
+
import { pt as LanguageString } from "../vocab-DnlmNyXi.cjs";
|
|
3
|
+
import { n as HttpMessageSignaturesSpecDeterminer } from "../http-CMzg-A9P.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 };
|