@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,23 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import "../
|
|
9
|
-
import "../
|
|
10
|
-
import "../
|
|
11
|
-
import "../
|
|
12
|
-
import { exportJwk, fetchKey, generateCryptoKeyPair, importJwk, validateCryptoKey } from "../key-CPJcJjp-.js";
|
|
13
|
-
import { mockDocumentLoader, test } from "../testing-RPOc_gVG.js";
|
|
14
|
-
import "../std__assert-X-_kMxKM.js";
|
|
15
|
-
import { assertRejects } from "../assert_rejects-DiIiJbZn.js";
|
|
16
|
-
import "../assert_is_error-BPGph1Jx.js";
|
|
17
|
-
import "../assert_not_equals-f3m3epl3.js";
|
|
18
|
-
import { assertThrows } from "../assert_throws-BOO88avQ.js";
|
|
19
|
-
import { ed25519Multikey, rsaPrivateKey2, rsaPublicKey1, rsaPublicKey2, rsaPublicKey3 } from "../keys-IZ5050fT.js";
|
|
20
|
-
|
|
1
|
+
import "@js-temporal/polyfill";
|
|
2
|
+
import "urlpattern-polyfill";
|
|
3
|
+
globalThis.addEventListener = () => {};
|
|
4
|
+
import { g as Multikey, s as CryptographicKey } from "../vocab-DuW9rL1h.mjs";
|
|
5
|
+
import { a as mockDocumentLoader, 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 assertRejects } from "../assert_rejects-CJC9ThS-.mjs";
|
|
9
|
+
import { t as assertThrows } from "../assert_throws-BIL7gChy.mjs";
|
|
10
|
+
import { a as validateCryptoKey, i as importJwk, n as fetchKey, r as generateCryptoKeyPair, t as exportJwk } from "../key-BNMK_IVr.mjs";
|
|
11
|
+
import { c as rsaPublicKey3, i as rsaPrivateKey2, o as rsaPublicKey1, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-B27nVeIs.mjs";
|
|
21
12
|
//#region src/sig/key.test.ts
|
|
22
13
|
test("validateCryptoKey()", async () => {
|
|
23
14
|
const pkcs1v15 = await crypto.subtle.generateKey({
|
|
@@ -245,5 +236,5 @@ test("fetchKey()", async () => {
|
|
|
245
236
|
cached: false
|
|
246
237
|
});
|
|
247
238
|
});
|
|
248
|
-
|
|
249
|
-
|
|
239
|
+
//#endregion
|
|
240
|
+
export {};
|
|
@@ -1,22 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import "../
|
|
10
|
-
import "../
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import { mockDocumentLoader, test } from "../testing-RPOc_gVG.js";
|
|
14
|
-
import { assertFalse, assertRejects } from "../assert_rejects-DiIiJbZn.js";
|
|
15
|
-
import "../assert_is_error-BPGph1Jx.js";
|
|
16
|
-
import { assertThrows } from "../assert_throws-BOO88avQ.js";
|
|
17
|
-
import { ed25519Multikey, ed25519PrivateKey, rsaPrivateKey2, rsaPrivateKey3, rsaPublicKey2, rsaPublicKey3 } from "../keys-IZ5050fT.js";
|
|
1
|
+
import "@js-temporal/polyfill";
|
|
2
|
+
import "urlpattern-polyfill";
|
|
3
|
+
globalThis.addEventListener = () => {};
|
|
4
|
+
import { s as CryptographicKey } from "../vocab-DuW9rL1h.mjs";
|
|
5
|
+
import { a as mockDocumentLoader, 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 assertThrows } from "../assert_throws-BIL7gChy.mjs";
|
|
9
|
+
import { t as assert } from "../assert-DikXweDx.mjs";
|
|
10
|
+
import { r as generateCryptoKeyPair } from "../key-BNMK_IVr.mjs";
|
|
11
|
+
import { a as signJsonLd, n as createSignature, o as verifyJsonLd, r as detachSignature, s as verifySignature, t as attachSignature } from "../ld-6jAVu3jV.mjs";
|
|
12
|
+
import { a as rsaPrivateKey3, c as rsaPublicKey3, i as rsaPrivateKey2, n as ed25519PrivateKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-B27nVeIs.mjs";
|
|
18
13
|
import { encodeBase64 } from "byte-encodings/base64";
|
|
19
|
-
|
|
20
14
|
//#region src/sig/ld.test.ts
|
|
21
15
|
test("attachSignature()", () => {
|
|
22
16
|
const sig = {
|
|
@@ -43,28 +37,23 @@ test("createSignature()", async () => {
|
|
|
43
37
|
id: "https://example.com/1",
|
|
44
38
|
type: "Create"
|
|
45
39
|
};
|
|
46
|
-
|
|
47
|
-
const key = await verifySignature(attachSignature(doc, sig), {
|
|
40
|
+
assertEquals(await verifySignature(attachSignature(doc, await createSignature(doc, rsaPrivateKey2, rsaPublicKey2.id, { contextLoader: mockDocumentLoader })), {
|
|
48
41
|
documentLoader: mockDocumentLoader,
|
|
49
42
|
contextLoader: mockDocumentLoader
|
|
50
|
-
});
|
|
51
|
-
assertEquals(key, rsaPublicKey2);
|
|
43
|
+
}), rsaPublicKey2);
|
|
52
44
|
assertRejects(() => createSignature(doc, rsaPublicKey2.publicKey, rsaPublicKey2.id, { contextLoader: mockDocumentLoader }), TypeError);
|
|
53
45
|
assertRejects(() => createSignature(doc, ed25519PrivateKey, ed25519Multikey.id, { contextLoader: mockDocumentLoader }), TypeError);
|
|
54
46
|
});
|
|
55
47
|
test("signJsonLd()", async () => {
|
|
56
|
-
|
|
48
|
+
assert(await verifyJsonLd(await signJsonLd({
|
|
57
49
|
"@context": "https://www.w3.org/ns/activitystreams",
|
|
58
50
|
id: "https://example.com/1",
|
|
59
51
|
type: "Create",
|
|
60
52
|
actor: "https://example.com/person2"
|
|
61
|
-
}
|
|
62
|
-
const signed = await signJsonLd(doc, rsaPrivateKey3, rsaPublicKey3.id, { contextLoader: mockDocumentLoader });
|
|
63
|
-
const verified = await verifyJsonLd(signed, {
|
|
53
|
+
}, rsaPrivateKey3, rsaPublicKey3.id, { contextLoader: mockDocumentLoader }), {
|
|
64
54
|
documentLoader: mockDocumentLoader,
|
|
65
55
|
contextLoader: mockDocumentLoader
|
|
66
|
-
});
|
|
67
|
-
assert(verified);
|
|
56
|
+
}));
|
|
68
57
|
});
|
|
69
58
|
const document = {
|
|
70
59
|
"@context": ["https://www.w3.org/ns/activitystreams", {
|
|
@@ -204,23 +193,19 @@ test("verifySignature()", async () => {
|
|
|
204
193
|
assertEquals(key4, key);
|
|
205
194
|
});
|
|
206
195
|
test("verifyJsonLd()", async () => {
|
|
207
|
-
|
|
196
|
+
assert(await verifyJsonLd(testVector, {
|
|
208
197
|
documentLoader: mockDocumentLoader,
|
|
209
198
|
contextLoader: mockDocumentLoader
|
|
210
|
-
});
|
|
211
|
-
|
|
212
|
-
const doc = {
|
|
199
|
+
}));
|
|
200
|
+
assertFalse(await verifyJsonLd(await signJsonLd({
|
|
213
201
|
"@context": "https://www.w3.org/ns/activitystreams",
|
|
214
202
|
id: "https://example.com/1",
|
|
215
203
|
type: "Create",
|
|
216
204
|
actor: "https://example.com/person2"
|
|
217
|
-
}
|
|
218
|
-
const signed = await signJsonLd(doc, rsaPrivateKey2, rsaPublicKey2.id, { contextLoader: mockDocumentLoader });
|
|
219
|
-
const verified2 = await verifyJsonLd(signed, {
|
|
205
|
+
}, rsaPrivateKey2, rsaPublicKey2.id, { contextLoader: mockDocumentLoader }), {
|
|
220
206
|
documentLoader: mockDocumentLoader,
|
|
221
207
|
contextLoader: mockDocumentLoader
|
|
222
|
-
});
|
|
223
|
-
assertFalse(verified2);
|
|
208
|
+
}));
|
|
224
209
|
});
|
|
225
|
-
|
|
226
|
-
|
|
210
|
+
//#endregion
|
|
211
|
+
export {};
|
package/dist/sig/mod.cjs
CHANGED
|
@@ -1,15 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
require(
|
|
6
|
-
require(
|
|
7
|
-
require('../lookup-C4_dVYz7.cjs');
|
|
8
|
-
const require_key = require('../key-DjS1X9TG.cjs');
|
|
9
|
-
const require_http = require('../http-BgopPF-8.cjs');
|
|
10
|
-
const require_proof = require('../proof-CX7ujFFX.cjs');
|
|
11
|
-
require('../sig-ByHXzqUi.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_key = require("../key-B-wFdaPB.cjs");
|
|
5
|
+
const require_http = require("../http-DKw-O_VY.cjs");
|
|
6
|
+
const require_proof = require("../proof-DLOy7HYU.cjs");
|
|
13
7
|
exports.attachSignature = require_proof.attachSignature;
|
|
14
8
|
exports.createProof = require_proof.createProof;
|
|
15
9
|
exports.createSignature = require_proof.createSignature;
|
|
@@ -27,4 +21,4 @@ exports.verifyJsonLd = require_proof.verifyJsonLd;
|
|
|
27
21
|
exports.verifyObject = require_proof.verifyObject;
|
|
28
22
|
exports.verifyProof = require_proof.verifyProof;
|
|
29
23
|
exports.verifyRequest = require_http.verifyRequest;
|
|
30
|
-
exports.verifySignature = require_proof.verifySignature;
|
|
24
|
+
exports.verifySignature = require_proof.verifySignature;
|
package/dist/sig/mod.d.cts
CHANGED
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import "../
|
|
2
|
-
import "../
|
|
3
|
-
import "../
|
|
4
|
-
import "../actor-Ydzhc8dj.cjs";
|
|
5
|
-
import { FetchKeyOptions, FetchKeyResult, HttpMessageSignaturesSpec, HttpMessageSignaturesSpecDeterminer, KeyCache, SignRequestOptions, VerifyRequestOptions, exportJwk, fetchKey, generateCryptoKeyPair, importJwk, signRequest, verifyRequest } from "../http-B1_DzfAU.cjs";
|
|
6
|
-
import { DoesActorOwnKeyOptions, GetKeyOwnerOptions, doesActorOwnKey, getKeyOwner } from "../owner-6KSEp9eV.cjs";
|
|
7
|
-
import { CreateProofOptions, CreateSignatureOptions, SignJsonLdOptions, SignObjectOptions, VerifyJsonLdOptions, VerifyObjectOptions, VerifyProofOptions, VerifySignatureOptions, attachSignature, createProof, createSignature, detachSignature, signJsonLd, signObject, verifyJsonLd, verifyObject, verifyProof, verifySignature } from "../mod-fjqfsrty.cjs";
|
|
1
|
+
import { a as signRequest, c as FetchKeyResult, d as fetchKey, f as generateCryptoKeyPair, i as VerifyRequestOptions, l as KeyCache, n as HttpMessageSignaturesSpecDeterminer, o as verifyRequest, p as importJwk, r as SignRequestOptions, s as FetchKeyOptions, t as HttpMessageSignaturesSpec, u as exportJwk } from "../http-C7WoprmE.cjs";
|
|
2
|
+
import { i as getKeyOwner, n as GetKeyOwnerOptions, r as doesActorOwnKey, t as DoesActorOwnKeyOptions } from "../owner-_rFs0ik_.cjs";
|
|
3
|
+
import { _ as verifyJsonLd, a as createProof, c as verifyProof, d as VerifyJsonLdOptions, f as VerifySignatureOptions, g as signJsonLd, h as detachSignature, i as VerifyProofOptions, l as CreateSignatureOptions, m as createSignature, n as SignObjectOptions, o as signObject, p as attachSignature, r as VerifyObjectOptions, s as verifyObject, t as CreateProofOptions, u as SignJsonLdOptions, v as verifySignature } from "../mod-Chb_NKPp.cjs";
|
|
8
4
|
export { CreateProofOptions, CreateSignatureOptions, DoesActorOwnKeyOptions, FetchKeyOptions, FetchKeyResult, GetKeyOwnerOptions, HttpMessageSignaturesSpec, HttpMessageSignaturesSpecDeterminer, KeyCache, SignJsonLdOptions, SignObjectOptions, SignRequestOptions, VerifyJsonLdOptions, VerifyObjectOptions, VerifyProofOptions, VerifyRequestOptions, VerifySignatureOptions, attachSignature, createProof, createSignature, detachSignature, doesActorOwnKey, exportJwk, fetchKey, generateCryptoKeyPair, getKeyOwner, importJwk, signJsonLd, signObject, signRequest, verifyJsonLd, verifyObject, verifyProof, verifyRequest, verifySignature };
|
package/dist/sig/mod.d.ts
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
-
import "../
|
|
4
|
-
import "../
|
|
5
|
-
import "../
|
|
6
|
-
import "../actor-C1Euqngb.js";
|
|
7
|
-
import { FetchKeyOptions, FetchKeyResult, HttpMessageSignaturesSpec, HttpMessageSignaturesSpecDeterminer, KeyCache, SignRequestOptions, VerifyRequestOptions, exportJwk, fetchKey, generateCryptoKeyPair, importJwk, signRequest, verifyRequest } from "../http-wsGR6KkT.js";
|
|
8
|
-
import { DoesActorOwnKeyOptions, GetKeyOwnerOptions, doesActorOwnKey, getKeyOwner } from "../owner-BbeUDvOu.js";
|
|
9
|
-
import { CreateProofOptions, CreateSignatureOptions, SignJsonLdOptions, SignObjectOptions, VerifyJsonLdOptions, VerifyObjectOptions, VerifyProofOptions, VerifySignatureOptions, attachSignature, createProof, createSignature, detachSignature, signJsonLd, signObject, verifyJsonLd, verifyObject, verifyProof, verifySignature } from "../mod-DgcYoyZK.js";
|
|
3
|
+
import { a as signRequest, c as FetchKeyResult, d as fetchKey, f as generateCryptoKeyPair, i as VerifyRequestOptions, l as KeyCache, n as HttpMessageSignaturesSpecDeterminer, o as verifyRequest, p as importJwk, r as SignRequestOptions, s as FetchKeyOptions, t as HttpMessageSignaturesSpec, u as exportJwk } from "../http-BZpls--H.js";
|
|
4
|
+
import { i as getKeyOwner, n as GetKeyOwnerOptions, r as doesActorOwnKey, t as DoesActorOwnKeyOptions } from "../owner-DPAPnB0R.js";
|
|
5
|
+
import { _ as verifyJsonLd, a as createProof, c as verifyProof, d as VerifyJsonLdOptions, f as VerifySignatureOptions, g as signJsonLd, h as detachSignature, i as VerifyProofOptions, l as CreateSignatureOptions, m as createSignature, n as SignObjectOptions, o as signObject, p as attachSignature, r as VerifyObjectOptions, s as verifyObject, t as CreateProofOptions, u as SignJsonLdOptions, v as verifySignature } from "../mod-DHoc3toL.js";
|
|
10
6
|
export { CreateProofOptions, CreateSignatureOptions, DoesActorOwnKeyOptions, FetchKeyOptions, FetchKeyResult, GetKeyOwnerOptions, HttpMessageSignaturesSpec, HttpMessageSignaturesSpecDeterminer, KeyCache, SignJsonLdOptions, SignObjectOptions, SignRequestOptions, VerifyJsonLdOptions, VerifyObjectOptions, VerifyProofOptions, VerifyRequestOptions, VerifySignatureOptions, attachSignature, createProof, createSignature, detachSignature, doesActorOwnKey, exportJwk, fetchKey, generateCryptoKeyPair, getKeyOwner, importJwk, signJsonLd, signObject, signRequest, verifyJsonLd, verifyObject, verifyProof, verifyRequest, verifySignature };
|
package/dist/sig/mod.js
CHANGED
|
@@ -1,13 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import "../
|
|
6
|
-
|
|
7
|
-
import "../lookup-CKZfuyxA.js";
|
|
8
|
-
import { exportJwk, fetchKey, generateCryptoKeyPair, importJwk } from "../key-ibMO03_0.js";
|
|
9
|
-
import { signRequest, verifyRequest } from "../http-CR-Eg1Uq.js";
|
|
10
|
-
import { attachSignature, createProof, createSignature, detachSignature, doesActorOwnKey, getKeyOwner, signJsonLd, signObject, verifyJsonLd, verifyObject, verifyProof, verifySignature } from "../proof-V1uQaB2y.js";
|
|
11
|
-
import "../sig-Cj3tk-ig.js";
|
|
12
|
-
|
|
13
|
-
export { attachSignature, createProof, createSignature, detachSignature, doesActorOwnKey, exportJwk, fetchKey, generateCryptoKeyPair, getKeyOwner, importJwk, signJsonLd, signObject, signRequest, verifyJsonLd, verifyObject, verifyProof, verifyRequest, verifySignature };
|
|
1
|
+
import "@js-temporal/polyfill";
|
|
2
|
+
import "urlpattern-polyfill";
|
|
3
|
+
import { i as importJwk, n as fetchKey, r as generateCryptoKeyPair, t as exportJwk } from "../key-DK3o0FEH.js";
|
|
4
|
+
import { n as signRequest, r as verifyRequest } from "../http-VJbz6sKD.js";
|
|
5
|
+
import { a as doesActorOwnKey, c as createSignature, d as signJsonLd, f as verifyJsonLd, i as verifyProof, l as detachSignature, n as signObject, o as getKeyOwner, p as verifySignature, r as verifyObject, s as attachSignature, t as createProof } from "../proof-CmTtG_t-.js";
|
|
6
|
+
export { attachSignature, createProof, createSignature, detachSignature, doesActorOwnKey, exportJwk, fetchKey, generateCryptoKeyPair, getKeyOwner, importJwk, signJsonLd, signObject, signRequest, verifyJsonLd, verifyObject, verifyProof, verifyRequest, verifySignature };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import "@js-temporal/polyfill";
|
|
2
|
+
import "urlpattern-polyfill";
|
|
3
|
+
globalThis.addEventListener = () => {};
|
|
4
|
+
import { o as Create } from "../vocab-DuW9rL1h.mjs";
|
|
5
|
+
import { t as lookupObject } from "../lookup-DmeJ8WUw.mjs";
|
|
6
|
+
import { a as mockDocumentLoader, t as test } from "../testing-DS3gcq8V.mjs";
|
|
7
|
+
import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
|
|
8
|
+
import "../std__assert-2v7gYiZp.mjs";
|
|
9
|
+
import { n as assertFalse } from "../assert_rejects-CJC9ThS-.mjs";
|
|
10
|
+
import { t as assert } from "../assert-DikXweDx.mjs";
|
|
11
|
+
import { n as getKeyOwner, t as doesActorOwnKey } from "../owner-CKuGt_T9.mjs";
|
|
12
|
+
import { o as rsaPublicKey1, s as rsaPublicKey2 } from "../keys-B27nVeIs.mjs";
|
|
13
|
+
//#region src/sig/owner.test.ts
|
|
14
|
+
test("doesActorOwnKey()", async () => {
|
|
15
|
+
const options = {
|
|
16
|
+
documentLoader: mockDocumentLoader,
|
|
17
|
+
contextLoader: mockDocumentLoader
|
|
18
|
+
};
|
|
19
|
+
const activity = new Create({ actor: new URL("https://example.com/person") });
|
|
20
|
+
assert(await doesActorOwnKey(activity, rsaPublicKey1, options));
|
|
21
|
+
assert(await doesActorOwnKey(activity, rsaPublicKey2, options));
|
|
22
|
+
const activity2 = new Create({ actor: new URL("https://example.com/hong-gildong") });
|
|
23
|
+
assertFalse(await doesActorOwnKey(activity2, rsaPublicKey1, options));
|
|
24
|
+
assertFalse(await doesActorOwnKey(activity2, rsaPublicKey2, options));
|
|
25
|
+
});
|
|
26
|
+
test("getKeyOwner()", async () => {
|
|
27
|
+
const options = {
|
|
28
|
+
documentLoader: mockDocumentLoader,
|
|
29
|
+
contextLoader: mockDocumentLoader
|
|
30
|
+
};
|
|
31
|
+
assertEquals(await getKeyOwner(new URL("https://example.com/users/handle#main-key"), options), await lookupObject("https://example.com/users/handle", options));
|
|
32
|
+
const owner2 = await getKeyOwner(new URL("https://example.com/key"), options);
|
|
33
|
+
assertEquals(owner2, await lookupObject("https://example.com/person", options));
|
|
34
|
+
assertEquals(await getKeyOwner(rsaPublicKey1, options), owner2);
|
|
35
|
+
assertEquals(await getKeyOwner(new URL("https://example.com/key2"), options), null);
|
|
36
|
+
assertEquals(await getKeyOwner(new URL("https://example.com/object"), options), null);
|
|
37
|
+
});
|
|
38
|
+
//#endregion
|
|
39
|
+
export {};
|
|
@@ -1,25 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import "../
|
|
9
|
-
import { assertInstanceOf } from "../assert_instance_of-
|
|
10
|
-
import "../
|
|
11
|
-
import "../
|
|
12
|
-
import "../key-CPJcJjp-.js";
|
|
13
|
-
import { createProof, signObject, verifyObject, verifyProof } from "../proof-exgGRW88.js";
|
|
14
|
-
import { mockDocumentLoader, test } from "../testing-RPOc_gVG.js";
|
|
15
|
-
import "../std__assert-X-_kMxKM.js";
|
|
16
|
-
import { assertRejects } from "../assert_rejects-DiIiJbZn.js";
|
|
17
|
-
import "../assert_is_error-BPGph1Jx.js";
|
|
18
|
-
import "../assert_not_equals-f3m3epl3.js";
|
|
19
|
-
import "../assert_throws-BOO88avQ.js";
|
|
20
|
-
import { ed25519Multikey, ed25519PrivateKey, ed25519PublicKey, rsaPrivateKey2, rsaPublicKey2 } from "../keys-IZ5050fT.js";
|
|
1
|
+
import { Temporal } from "@js-temporal/polyfill";
|
|
2
|
+
import "urlpattern-polyfill";
|
|
3
|
+
globalThis.addEventListener = () => {};
|
|
4
|
+
import { L as decode, N as importMultibaseKey, _ as Note, c as DataIntegrityProof, g as Multikey, o as Create, w as Place } from "../vocab-DuW9rL1h.mjs";
|
|
5
|
+
import { a as mockDocumentLoader, 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 assertRejects } from "../assert_rejects-CJC9ThS-.mjs";
|
|
9
|
+
import { t as assertInstanceOf } from "../assert_instance_of-C4Ri6VuN.mjs";
|
|
10
|
+
import { i as verifyProof, n as signObject, r as verifyObject, t as createProof } from "../proof-mJLL2gSA.mjs";
|
|
11
|
+
import { i as rsaPrivateKey2, n as ed25519PrivateKey, r as ed25519PublicKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-B27nVeIs.mjs";
|
|
21
12
|
import { decodeHex, encodeHex } from "byte-encodings/hex";
|
|
22
|
-
|
|
23
13
|
//#region src/sig/proof.test.ts
|
|
24
14
|
const fep8b32TestVectorPrivateKey = await crypto.subtle.importKey("jwk", {
|
|
25
15
|
"kty": "OKP",
|
|
@@ -119,11 +109,10 @@ test("signObject()", async () => {
|
|
|
119
109
|
created: "2023-02-24T23:36:38Z"
|
|
120
110
|
}
|
|
121
111
|
});
|
|
122
|
-
|
|
112
|
+
assertEquals(await (await signObject(signedObject, ed25519PrivateKey, ed25519Multikey.id, {
|
|
123
113
|
...options,
|
|
124
114
|
created
|
|
125
|
-
})
|
|
126
|
-
assertEquals(await signedObject2.toJsonLd(options), {
|
|
115
|
+
})).toJsonLd(options), {
|
|
127
116
|
"@context": ["https://www.w3.org/ns/activitystreams", "https://w3id.org/security/data-integrity/v1"],
|
|
128
117
|
id: "https://server.example/activities/1",
|
|
129
118
|
type: "Create",
|
|
@@ -211,16 +200,14 @@ test("verifyProof()", async () => {
|
|
|
211
200
|
cache["https://server.example/users/alice#ed25519-key"] = ed25519Multikey;
|
|
212
201
|
assertEquals(await verifyProof(jsonLd, proof, options), expectedKey);
|
|
213
202
|
assertEquals(cache["https://server.example/users/alice#ed25519-key"], expectedKey);
|
|
214
|
-
|
|
203
|
+
assertEquals(await verifyProof({
|
|
215
204
|
...jsonLd,
|
|
216
205
|
object: {
|
|
217
206
|
...jsonLd.object,
|
|
218
207
|
content: "bye"
|
|
219
208
|
}
|
|
220
|
-
};
|
|
221
|
-
assertEquals(await verifyProof(
|
|
222
|
-
const wrongProof = proof.clone({ created: Temporal.Now.instant() });
|
|
223
|
-
assertEquals(await verifyProof(jsonLd, wrongProof, options), null);
|
|
209
|
+
}, proof, options), null);
|
|
210
|
+
assertEquals(await verifyProof(jsonLd, proof.clone({ created: Temporal.Now.instant() }), options), null);
|
|
224
211
|
});
|
|
225
212
|
test("verifyObject()", async () => {
|
|
226
213
|
const options = {
|
|
@@ -265,5 +252,5 @@ test("verifyObject()", async () => {
|
|
|
265
252
|
assertInstanceOf(note, Note);
|
|
266
253
|
assertEquals(note.content, "Hello world");
|
|
267
254
|
});
|
|
268
|
-
|
|
269
|
-
|
|
255
|
+
//#endregion
|
|
256
|
+
export {};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import
|
|
7
|
-
|
|
1
|
+
import "@js-temporal/polyfill";
|
|
2
|
+
import "urlpattern-polyfill";
|
|
3
|
+
globalThis.addEventListener = () => {};
|
|
4
|
+
import { a as red, i as buildMessage, l as AssertionError, n as diffStr, r as diff, s as format } from "./assert_equals-Ew3jOFa3.mjs";
|
|
5
|
+
import "./assert_rejects-CJC9ThS-.mjs";
|
|
6
|
+
import "./assert_is_error-C50x8tnw.mjs";
|
|
7
|
+
import "./assert_throws-BIL7gChy.mjs";
|
|
8
8
|
//#region ../../node_modules/.pnpm/@jsr+std__assert@0.226.0/node_modules/@jsr/std__assert/assert_exists.js
|
|
9
9
|
/**
|
|
10
10
|
* Make an assertion that actual is not null or undefined.
|
|
@@ -23,12 +23,10 @@ import { AssertionError, buildMessage, diff, diffStr, format, red } from "./asse
|
|
|
23
23
|
* @param msg The optional message to include in the error if the assertion fails.
|
|
24
24
|
*/ function assertExists(actual, msg) {
|
|
25
25
|
if (actual === void 0 || actual === null) {
|
|
26
|
-
|
|
27
|
-
msg = `Expected actual: "${actual}" to not be null or undefined${msgSuffix}`;
|
|
26
|
+
msg = `Expected actual: "${actual}" to not be null or undefined${msg ? `: ${msg}` : "."}`;
|
|
28
27
|
throw new AssertionError(msg);
|
|
29
28
|
}
|
|
30
29
|
}
|
|
31
|
-
|
|
32
30
|
//#endregion
|
|
33
31
|
//#region ../../node_modules/.pnpm/@jsr+std__assert@0.226.0/node_modules/@jsr/std__assert/assert_greater_or_equal.js
|
|
34
32
|
/**
|
|
@@ -54,7 +52,6 @@ import { AssertionError, buildMessage, diff, diffStr, format, red } from "./asse
|
|
|
54
52
|
const expectedString = format(expected);
|
|
55
53
|
throw new AssertionError(msg ?? `Expect ${actualString} >= ${expectedString}`);
|
|
56
54
|
}
|
|
57
|
-
|
|
58
55
|
//#endregion
|
|
59
56
|
//#region ../../node_modules/.pnpm/@jsr+std__assert@0.226.0/node_modules/@jsr/std__assert/assert_greater.js
|
|
60
57
|
/**
|
|
@@ -80,7 +77,6 @@ import { AssertionError, buildMessage, diff, diffStr, format, red } from "./asse
|
|
|
80
77
|
const expectedString = format(expected);
|
|
81
78
|
throw new AssertionError(msg ?? `Expect ${actualString} > ${expectedString}`);
|
|
82
79
|
}
|
|
83
|
-
|
|
84
80
|
//#endregion
|
|
85
81
|
//#region ../../node_modules/.pnpm/@jsr+std__assert@0.226.0/node_modules/@jsr/std__assert/assert_strict_equals.js
|
|
86
82
|
/**
|
|
@@ -110,18 +106,13 @@ import { AssertionError, buildMessage, diff, diffStr, format, red } from "./asse
|
|
|
110
106
|
let message;
|
|
111
107
|
const actualString = format(actual);
|
|
112
108
|
const expectedString = format(expected);
|
|
113
|
-
if (actualString === expectedString) {
|
|
114
|
-
|
|
115
|
-
message = `Values have the same structure but are not reference-equal${msgSuffix}\n\n${red(withOffset)}\n`;
|
|
116
|
-
} else {
|
|
109
|
+
if (actualString === expectedString) message = `Values have the same structure but are not reference-equal${msgSuffix}\n\n${red(actualString.split("\n").map((l) => ` ${l}`).join("\n"))}\n`;
|
|
110
|
+
else {
|
|
117
111
|
const stringDiff = typeof actual === "string" && typeof expected === "string";
|
|
118
|
-
|
|
119
|
-
const diffMsg = buildMessage(diffResult, { stringDiff }).join("\n");
|
|
120
|
-
message = `Values are not strictly equal${msgSuffix}\n${diffMsg}`;
|
|
112
|
+
message = `Values are not strictly equal${msgSuffix}\n${buildMessage(stringDiff ? diffStr(actual, expected) : diff(actualString.split("\n"), expectedString.split("\n")), { stringDiff }).join("\n")}`;
|
|
121
113
|
}
|
|
122
114
|
throw new AssertionError(message);
|
|
123
115
|
}
|
|
124
|
-
|
|
125
116
|
//#endregion
|
|
126
117
|
//#region ../../node_modules/.pnpm/@jsr+std__assert@0.226.0/node_modules/@jsr/std__assert/assert_string_includes.js
|
|
127
118
|
/**
|
|
@@ -141,11 +132,9 @@ import { AssertionError, buildMessage, diff, diffStr, format, red } from "./asse
|
|
|
141
132
|
* @param msg The optional message to display if the assertion fails.
|
|
142
133
|
*/ function assertStringIncludes(actual, expected, msg) {
|
|
143
134
|
if (!actual.includes(expected)) {
|
|
144
|
-
|
|
145
|
-
msg = `Expected actual: "${actual}" to contain: "${expected}"${msgSuffix}`;
|
|
135
|
+
msg = `Expected actual: "${actual}" to contain: "${expected}"${msg ? `: ${msg}` : "."}`;
|
|
146
136
|
throw new AssertionError(msg);
|
|
147
137
|
}
|
|
148
138
|
}
|
|
149
|
-
|
|
150
139
|
//#endregion
|
|
151
|
-
export { assertExists
|
|
140
|
+
export { assertExists as a, assertGreaterOrEqual as i, assertStrictEquals as n, assertGreater as r, assertStringIncludes as t };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import "@js-temporal/polyfill";
|
|
2
|
+
import "urlpattern-polyfill";
|
|
3
|
+
globalThis.addEventListener = () => {};
|
|
4
|
+
import { a as mockDocumentLoader, t as test } from "../testing-DS3gcq8V.mjs";
|
|
5
|
+
import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
|
|
6
|
+
import "../std__assert-2v7gYiZp.mjs";
|
|
7
|
+
//#region src/testing/docloader.test.ts
|
|
8
|
+
test("mockDocumentLoader()", async () => {
|
|
9
|
+
assertEquals(await (await mockDocumentLoader("https://example.com/test")).document, { "https://example.com/prop/test": { "@value": "foo" } });
|
|
10
|
+
});
|
|
11
|
+
//#endregion
|
|
12
|
+
export {};
|