@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,15 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import { __commonJS, __toESM } from "./type-COPv6pMi.js";
|
|
7
|
-
|
|
1
|
+
import "@js-temporal/polyfill";
|
|
2
|
+
import "urlpattern-polyfill";
|
|
3
|
+
globalThis.addEventListener = () => {};
|
|
4
|
+
import { ct as __commonJSMin, dt as __toESM } from "./vocab-DuW9rL1h.mjs";
|
|
8
5
|
//#region ../../node_modules/.pnpm/glob-to-regexp@0.4.1/node_modules/glob-to-regexp/index.js
|
|
9
|
-
var require_glob_to_regexp =
|
|
10
|
-
module.exports = function(glob
|
|
11
|
-
if (typeof glob
|
|
12
|
-
var str = String(glob
|
|
6
|
+
var require_glob_to_regexp = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
7
|
+
module.exports = function(glob, opts) {
|
|
8
|
+
if (typeof glob !== "string") throw new TypeError("Expected a string");
|
|
9
|
+
var str = String(glob);
|
|
13
10
|
var reStr = "";
|
|
14
11
|
var extended = opts ? !!opts.extended : false;
|
|
15
12
|
var globstar = opts ? !!opts.globstar : false;
|
|
@@ -66,13 +63,10 @@ var require_glob_to_regexp = __commonJS({ "../../node_modules/.pnpm/glob-to-rege
|
|
|
66
63
|
}
|
|
67
64
|
var nextChar = str[i + 1];
|
|
68
65
|
if (!globstar) reStr += ".*";
|
|
69
|
-
else {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
i++;
|
|
74
|
-
} else reStr += "([^/]*)";
|
|
75
|
-
}
|
|
66
|
+
else if (starCount > 1 && (prevChar === "/" || prevChar === void 0) && (nextChar === "/" || nextChar === void 0)) {
|
|
67
|
+
reStr += "((?:[^/]*(?:/|$))*)";
|
|
68
|
+
i++;
|
|
69
|
+
} else reStr += "([^/]*)";
|
|
76
70
|
break;
|
|
77
71
|
default: reStr += c;
|
|
78
72
|
}
|
|
@@ -80,8 +74,7 @@ var require_glob_to_regexp = __commonJS({ "../../node_modules/.pnpm/glob-to-rege
|
|
|
80
74
|
if (!flags || !~flags.indexOf("g")) reStr = "^" + reStr + "$";
|
|
81
75
|
return new RegExp(reStr, flags);
|
|
82
76
|
};
|
|
83
|
-
}
|
|
84
|
-
|
|
77
|
+
}));
|
|
85
78
|
//#endregion
|
|
86
79
|
//#region ../../node_modules/.pnpm/regexparam@3.0.0/node_modules/regexparam/dist/index.mjs
|
|
87
80
|
/**
|
|
@@ -113,7 +106,6 @@ function parse(input, loose) {
|
|
|
113
106
|
pattern: new RegExp("^" + pattern + (loose ? "(?=$|/)" : "/?$"), "i")
|
|
114
107
|
};
|
|
115
108
|
}
|
|
116
|
-
|
|
117
109
|
//#endregion
|
|
118
110
|
//#region ../../node_modules/.pnpm/fetch-mock@12.5.3/node_modules/fetch-mock/dist/esm/TypeDescriptor.js
|
|
119
111
|
const valueTypes = new Set([
|
|
@@ -205,7 +197,6 @@ var TypeDescriptor = class TypeDescriptor {
|
|
|
205
197
|
return TypeDescriptor.of(value) === "undefined";
|
|
206
198
|
}
|
|
207
199
|
};
|
|
208
|
-
|
|
209
200
|
//#endregion
|
|
210
201
|
//#region ../../node_modules/.pnpm/fetch-mock@12.5.3/node_modules/fetch-mock/dist/esm/IsSubsetOf.js
|
|
211
202
|
const allowedTypes = new Set([
|
|
@@ -232,7 +223,7 @@ const isSubsetOf = function(subset, superset, visited = []) {
|
|
|
232
223
|
switch (subsetItemType) {
|
|
233
224
|
case "array":
|
|
234
225
|
case "object":
|
|
235
|
-
case "function":
|
|
226
|
+
case "function":
|
|
236
227
|
if (visited.includes(subsetItem)) continue;
|
|
237
228
|
visited.push(subsetItem);
|
|
238
229
|
isItemInSuperset = superset.some((supersetItem) => {
|
|
@@ -243,7 +234,6 @@ const isSubsetOf = function(subset, superset, visited = []) {
|
|
|
243
234
|
}
|
|
244
235
|
});
|
|
245
236
|
break;
|
|
246
|
-
}
|
|
247
237
|
default: isItemInSuperset = superset.includes(subsetItem);
|
|
248
238
|
}
|
|
249
239
|
if (!isItemInSuperset) return false;
|
|
@@ -255,21 +245,18 @@ const isSubsetOf = function(subset, superset, visited = []) {
|
|
|
255
245
|
if (Object.keys(subset).length > Object.keys(superset).length) return false;
|
|
256
246
|
for (const [subsetKey, subsetValue] of Object.entries(subset)) {
|
|
257
247
|
const supersetValue = superset[subsetKey];
|
|
258
|
-
|
|
259
|
-
switch (subsetValueType) {
|
|
248
|
+
switch (TypeDescriptor.of(subsetValue)) {
|
|
260
249
|
case "array":
|
|
261
250
|
case "object":
|
|
262
|
-
case "function":
|
|
251
|
+
case "function":
|
|
263
252
|
if (visited.includes(subsetValue)) continue;
|
|
264
253
|
visited.push(subsetValue);
|
|
265
254
|
try {
|
|
266
|
-
|
|
267
|
-
if (!isInSuperset) return false;
|
|
255
|
+
if (!isSubsetOf(subsetValue, supersetValue, visited)) return false;
|
|
268
256
|
} catch {
|
|
269
257
|
return false;
|
|
270
258
|
}
|
|
271
259
|
break;
|
|
272
|
-
}
|
|
273
260
|
default: if (subsetValue !== supersetValue) return false;
|
|
274
261
|
}
|
|
275
262
|
}
|
|
@@ -292,8 +279,7 @@ isSubsetOf.structural = function(subset, superset, visited = []) {
|
|
|
292
279
|
if (visited.includes(subsetValue)) continue;
|
|
293
280
|
visited.push(subsetValue);
|
|
294
281
|
try {
|
|
295
|
-
|
|
296
|
-
if (!isInSuperset) return false;
|
|
282
|
+
if (!isSubsetOf.structural(subsetValue, supersetValue, visited)) return false;
|
|
297
283
|
} catch {
|
|
298
284
|
return false;
|
|
299
285
|
}
|
|
@@ -301,7 +287,6 @@ isSubsetOf.structural = function(subset, superset, visited = []) {
|
|
|
301
287
|
}
|
|
302
288
|
return true;
|
|
303
289
|
};
|
|
304
|
-
|
|
305
290
|
//#endregion
|
|
306
291
|
//#region ../../node_modules/.pnpm/dequal@2.0.3/node_modules/dequal/dist/index.mjs
|
|
307
292
|
var has = Object.prototype.hasOwnProperty;
|
|
@@ -364,11 +349,10 @@ function dequal(foo, bar) {
|
|
|
364
349
|
}
|
|
365
350
|
return foo !== foo && bar !== bar;
|
|
366
351
|
}
|
|
367
|
-
|
|
368
352
|
//#endregion
|
|
369
353
|
//#region ../../node_modules/.pnpm/fetch-mock@12.5.3/node_modules/fetch-mock/dist/esm/RequestUtils.js
|
|
370
|
-
const absoluteUrlRX = new RegExp("^[a-z]+://|^data:", "i");
|
|
371
|
-
const protocolRelativeUrlRX = new RegExp("^//", "i");
|
|
354
|
+
const absoluteUrlRX = /* @__PURE__ */ new RegExp("^[a-z]+://|^data:", "i");
|
|
355
|
+
const protocolRelativeUrlRX = /* @__PURE__ */ new RegExp("^//", "i");
|
|
372
356
|
function hasCredentialsInUrl(url) {
|
|
373
357
|
const urlObject = new URL(url, !absoluteUrlRX.test(url) ? "http://dummy" : void 0);
|
|
374
358
|
return Boolean(urlObject.username || urlObject.password);
|
|
@@ -416,7 +400,7 @@ async function createCallLogFromRequest(request, options) {
|
|
|
416
400
|
} catch {}
|
|
417
401
|
if (request.headers) derivedOptions.headers = normalizeHeaders(request.headers);
|
|
418
402
|
const url = normalizeUrl(request.url, true);
|
|
419
|
-
|
|
403
|
+
return {
|
|
420
404
|
args: [request, options],
|
|
421
405
|
url,
|
|
422
406
|
queryParams: new URLSearchParams(getQuery(url)),
|
|
@@ -425,11 +409,9 @@ async function createCallLogFromRequest(request, options) {
|
|
|
425
409
|
signal: options && options.signal || request.signal,
|
|
426
410
|
pendingPromises
|
|
427
411
|
};
|
|
428
|
-
return callLog;
|
|
429
412
|
}
|
|
430
413
|
function getPath(url) {
|
|
431
|
-
|
|
432
|
-
return u.pathname;
|
|
414
|
+
return (absoluteUrlRX.test(url) ? new URL(url) : new URL(url, "http://dummy")).pathname;
|
|
433
415
|
}
|
|
434
416
|
function getQuery(url) {
|
|
435
417
|
const u = absoluteUrlRX.test(url) ? new URL(url) : new URL(url, "http://dummy");
|
|
@@ -442,10 +424,9 @@ function normalizeHeaders(headers) {
|
|
|
442
424
|
else entries = Object.entries(headers);
|
|
443
425
|
return Object.fromEntries(entries.map(([key, val]) => [key.toLowerCase(), String(val).valueOf()]));
|
|
444
426
|
}
|
|
445
|
-
|
|
446
427
|
//#endregion
|
|
447
428
|
//#region ../../node_modules/.pnpm/fetch-mock@12.5.3/node_modules/fetch-mock/dist/esm/Matchers.js
|
|
448
|
-
var import_glob_to_regexp = __toESM(require_glob_to_regexp(), 1);
|
|
429
|
+
var import_glob_to_regexp = /* @__PURE__ */ __toESM(require_glob_to_regexp(), 1);
|
|
449
430
|
const isUrlMatcher = (matcher) => matcher instanceof RegExp || typeof matcher === "string" || typeof matcher === "object" && "href" in matcher;
|
|
450
431
|
const isFunctionMatcher = (matcher) => typeof matcher === "function";
|
|
451
432
|
const stringMatchers = {
|
|
@@ -496,8 +477,7 @@ const getMissingHeaderMatcher = ({ missingHeaders: expectedMissingHeaders }) =>
|
|
|
496
477
|
const getMethodMatcher = ({ method: expectedMethod }) => {
|
|
497
478
|
if (!expectedMethod) return;
|
|
498
479
|
return ({ options: { method } = {} }) => {
|
|
499
|
-
|
|
500
|
-
return expectedMethod === actualMethod;
|
|
480
|
+
return expectedMethod === (method ? method.toLowerCase() : "get");
|
|
501
481
|
};
|
|
502
482
|
};
|
|
503
483
|
const getQueryParamsMatcher = ({ query: passedQuery }) => {
|
|
@@ -576,7 +556,7 @@ const getUrlMatcher = (route) => {
|
|
|
576
556
|
}
|
|
577
557
|
if (typeof matcherUrl === "string") {
|
|
578
558
|
for (const shorthand in stringMatchers) if (matcherUrl.indexOf(`${shorthand}:`) === 0) {
|
|
579
|
-
const urlFragment = matcherUrl.replace(
|
|
559
|
+
const urlFragment = matcherUrl.replace(new RegExp(`^${shorthand}:`), "");
|
|
580
560
|
return stringMatchers[shorthand](urlFragment);
|
|
581
561
|
}
|
|
582
562
|
return getFullUrlMatcher(route, matcherUrl, query);
|
|
@@ -587,7 +567,7 @@ const getUrlMatcher = (route) => {
|
|
|
587
567
|
else if (key in stringMatchers) return stringMatchers[key](pattern);
|
|
588
568
|
else throw new Error(`unrecognised url matching pattern: ${key}`);
|
|
589
569
|
});
|
|
590
|
-
return (route
|
|
570
|
+
return (route) => matchers.every((matcher) => matcher(route));
|
|
591
571
|
}
|
|
592
572
|
};
|
|
593
573
|
const builtInMatchers = [
|
|
@@ -625,7 +605,6 @@ const builtInMatchers = [
|
|
|
625
605
|
matcher: getFunctionMatcher
|
|
626
606
|
}
|
|
627
607
|
];
|
|
628
|
-
|
|
629
608
|
//#endregion
|
|
630
609
|
//#region ../../node_modules/.pnpm/fetch-mock@12.5.3/node_modules/fetch-mock/dist/esm/StatusTextMap.js
|
|
631
610
|
const statusTextMap = {
|
|
@@ -692,17 +671,15 @@ const statusTextMap = {
|
|
|
692
671
|
510: "Not Extended",
|
|
693
672
|
511: "Network Authentication Required"
|
|
694
673
|
};
|
|
695
|
-
var StatusTextMap_default = statusTextMap;
|
|
696
|
-
|
|
697
674
|
//#endregion
|
|
698
675
|
//#region ../../node_modules/.pnpm/fetch-mock@12.5.3/node_modules/fetch-mock/dist/esm/Route.js
|
|
699
|
-
var __classPrivateFieldSet =
|
|
676
|
+
var __classPrivateFieldSet = function(receiver, state, value, kind, f) {
|
|
700
677
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
701
678
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
702
679
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
703
680
|
return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value;
|
|
704
681
|
};
|
|
705
|
-
var __classPrivateFieldGet =
|
|
682
|
+
var __classPrivateFieldGet = function(receiver, state, kind, f) {
|
|
706
683
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
707
684
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
708
685
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
@@ -763,14 +740,13 @@ var Route = class {
|
|
|
763
740
|
constructResponseOptions(responseInput) {
|
|
764
741
|
const options = responseInput.options || {};
|
|
765
742
|
options.status = sanitizeStatus(responseInput.status);
|
|
766
|
-
options.statusText =
|
|
743
|
+
options.statusText = statusTextMap[options.status];
|
|
767
744
|
options.headers = new this.config.Headers(responseInput.headers);
|
|
768
745
|
return options;
|
|
769
746
|
}
|
|
770
747
|
constructResponseBody(responseInput, responseOptions) {
|
|
771
748
|
let body = responseInput.body;
|
|
772
|
-
|
|
773
|
-
if (!bodyIsBodyInit) if (typeof body === "undefined") body = null;
|
|
749
|
+
if (!isBodyInit(body)) if (typeof body === "undefined") body = null;
|
|
774
750
|
else if (typeof body === "object") {
|
|
775
751
|
body = JSON.stringify(body);
|
|
776
752
|
if (!responseOptions.headers.has("Content-Type")) responseOptions.headers.set("Content-Type", "application/json");
|
|
@@ -789,26 +765,25 @@ var Route = class {
|
|
|
789
765
|
_a.registeredMatchers.push(matcher);
|
|
790
766
|
}
|
|
791
767
|
};
|
|
792
|
-
_a = Route, _Route_responseSubscriptions = /* @__PURE__ */ new WeakMap(), _Route_instances = /* @__PURE__ */ new WeakSet(), _Route_validate = function _Route_validate
|
|
768
|
+
_a = Route, _Route_responseSubscriptions = /* @__PURE__ */ new WeakMap(), _Route_instances = /* @__PURE__ */ new WeakSet(), _Route_validate = function _Route_validate() {
|
|
793
769
|
if (["matched", "unmatched"].includes(this.config.name)) throw new Error(`fetch-mock: Routes cannot use the reserved name \`${this.config.name}\``);
|
|
794
770
|
if (!("response" in this.config)) throw new Error("fetch-mock: Each route must define a response");
|
|
795
771
|
if (!_a.registeredMatchers.some(({ name }) => name in this.config)) throw new Error("fetch-mock: Each route must specify some criteria for matching calls to fetch. To match all calls use '*'");
|
|
796
|
-
}, _Route_sanitize = function _Route_sanitize
|
|
772
|
+
}, _Route_sanitize = function _Route_sanitize() {
|
|
797
773
|
if (this.config.method) this.config.method = this.config.method.toLowerCase();
|
|
798
|
-
}, _Route_generateMatcher = function _Route_generateMatcher
|
|
774
|
+
}, _Route_generateMatcher = function _Route_generateMatcher() {
|
|
799
775
|
const activeMatchers = _a.registeredMatchers.filter(({ name }) => name in this.config).map(({ matcher, usesBody }) => ({
|
|
800
776
|
matcher: matcher(this.config),
|
|
801
777
|
usesBody
|
|
802
778
|
}));
|
|
803
779
|
this.config.usesBody = activeMatchers.some(({ usesBody }) => usesBody);
|
|
804
780
|
this.matcher = (normalizedRequest) => activeMatchers.every(({ matcher }) => matcher(normalizedRequest));
|
|
805
|
-
}, _Route_limit = function _Route_limit
|
|
781
|
+
}, _Route_limit = function _Route_limit() {
|
|
806
782
|
if (!this.config.repeat) return;
|
|
807
783
|
const originalMatcher = this.matcher;
|
|
808
784
|
let timesLeft = this.config.repeat;
|
|
809
785
|
this.matcher = (callLog) => {
|
|
810
|
-
|
|
811
|
-
if (match) {
|
|
786
|
+
if (timesLeft && originalMatcher(callLog)) {
|
|
812
787
|
timesLeft--;
|
|
813
788
|
return true;
|
|
814
789
|
}
|
|
@@ -816,7 +791,7 @@ _a = Route, _Route_responseSubscriptions = /* @__PURE__ */ new WeakMap(), _Route
|
|
|
816
791
|
this.reset = () => {
|
|
817
792
|
timesLeft = this.config.repeat;
|
|
818
793
|
};
|
|
819
|
-
}, _Route_delayResponse = function _Route_delayResponse
|
|
794
|
+
}, _Route_delayResponse = function _Route_delayResponse() {
|
|
820
795
|
if (this.config.delay) {
|
|
821
796
|
const { response } = this.config;
|
|
822
797
|
this.config.response = () => {
|
|
@@ -826,8 +801,6 @@ _a = Route, _Route_responseSubscriptions = /* @__PURE__ */ new WeakMap(), _Route
|
|
|
826
801
|
};
|
|
827
802
|
Route.registeredMatchers = [];
|
|
828
803
|
builtInMatchers.forEach(Route.defineMatcher);
|
|
829
|
-
var Route_default = Route;
|
|
830
|
-
|
|
831
804
|
//#endregion
|
|
832
805
|
//#region ../../node_modules/.pnpm/fetch-mock@12.5.3/node_modules/fetch-mock/dist/esm/Router.js
|
|
833
806
|
const responseConfigProps = [
|
|
@@ -895,8 +868,7 @@ var Router = class {
|
|
|
895
868
|
callLog.signal.addEventListener("abort", abort);
|
|
896
869
|
}
|
|
897
870
|
if (this.needsToReadBody(request)) options.body = await options.body;
|
|
898
|
-
const
|
|
899
|
-
const route = routesToTry.find((route$1) => route$1.matcher(callLog));
|
|
871
|
+
const route = (this.fallbackRoute ? [...this.routes, this.fallbackRoute] : this.routes).find((route) => route.matcher(callLog));
|
|
900
872
|
if (route) try {
|
|
901
873
|
callLog.route = route;
|
|
902
874
|
const { response, responseOptions, responseInput } = await this.generateResponse(callLog);
|
|
@@ -949,7 +921,7 @@ var Router = class {
|
|
|
949
921
|
else Object.assign(config, matcher);
|
|
950
922
|
if (typeof response !== "undefined") config.response = response;
|
|
951
923
|
if (nameOrOptions) Object.assign(config, typeof nameOrOptions === "string" ? nameToOptions(nameOrOptions) : nameOrOptions);
|
|
952
|
-
const route = new
|
|
924
|
+
const route = new Route({
|
|
953
925
|
...this.config,
|
|
954
926
|
...config
|
|
955
927
|
});
|
|
@@ -968,7 +940,7 @@ var Router = class {
|
|
|
968
940
|
}
|
|
969
941
|
setFallback(response) {
|
|
970
942
|
if (this.fallbackRoute) console.warn("calling fetchMock.catch() twice - are you sure you want to overwrite the previous fallback response");
|
|
971
|
-
this.fallbackRoute = new
|
|
943
|
+
this.fallbackRoute = new Route({
|
|
972
944
|
matcherFunction: () => true,
|
|
973
945
|
response: response || "ok",
|
|
974
946
|
...this.config
|
|
@@ -1000,7 +972,6 @@ var Router = class {
|
|
|
1000
972
|
route.init(newConfig);
|
|
1001
973
|
}
|
|
1002
974
|
};
|
|
1003
|
-
|
|
1004
975
|
//#endregion
|
|
1005
976
|
//#region ../../node_modules/.pnpm/fetch-mock@12.5.3/node_modules/fetch-mock/dist/esm/CallHistory.js
|
|
1006
977
|
const isName = (filter) => typeof filter === "string" && /^[\da-zA-Z-]+$/.test(filter) && !["matched", "unmatched"].includes(filter);
|
|
@@ -1046,12 +1017,12 @@ var CallHistory = class {
|
|
|
1046
1017
|
...filter,
|
|
1047
1018
|
...options || {}
|
|
1048
1019
|
};
|
|
1049
|
-
const { matcher } = new
|
|
1020
|
+
const { matcher } = new Route({
|
|
1050
1021
|
response: "ok",
|
|
1051
1022
|
...options
|
|
1052
1023
|
});
|
|
1053
|
-
calls = calls.filter(({ url, options
|
|
1054
|
-
return matcher(createCallLogFromUrlAndOptions(url, options
|
|
1024
|
+
calls = calls.filter(({ url, options }) => {
|
|
1025
|
+
return matcher(createCallLogFromUrlAndOptions(url, options));
|
|
1055
1026
|
});
|
|
1056
1027
|
return calls;
|
|
1057
1028
|
}
|
|
@@ -1084,8 +1055,6 @@ var CallHistory = class {
|
|
|
1084
1055
|
}).every((isDone) => isDone);
|
|
1085
1056
|
}
|
|
1086
1057
|
};
|
|
1087
|
-
var CallHistory_default = CallHistory;
|
|
1088
|
-
|
|
1089
1058
|
//#endregion
|
|
1090
1059
|
//#region ../../node_modules/.pnpm/fetch-mock@12.5.3/node_modules/fetch-mock/dist/esm/FetchMock.js
|
|
1091
1060
|
const defaultFetchMockConfig = {
|
|
@@ -1107,7 +1076,9 @@ const defineGreedyShorthand = (shorthandOptions) => {
|
|
|
1107
1076
|
return this.route("*", response, Object.assign(options || {}, shorthandOptions));
|
|
1108
1077
|
};
|
|
1109
1078
|
};
|
|
1110
|
-
|
|
1079
|
+
//#endregion
|
|
1080
|
+
//#region ../../node_modules/.pnpm/fetch-mock@12.5.3/node_modules/fetch-mock/dist/esm/index.js
|
|
1081
|
+
var esm_default = new class FetchMock {
|
|
1111
1082
|
constructor(config, router) {
|
|
1112
1083
|
this.sticky = defineShorthand({ sticky: true });
|
|
1113
1084
|
this.once = defineShorthand({ repeat: 1 });
|
|
@@ -1148,7 +1119,7 @@ var FetchMock = class FetchMock {
|
|
|
1148
1119
|
routes: router ? [...router.routes] : [],
|
|
1149
1120
|
fallbackRoute: router ? router.fallbackRoute : null
|
|
1150
1121
|
});
|
|
1151
|
-
this.callHistory = new
|
|
1122
|
+
this.callHistory = new CallHistory(this.config, this.router);
|
|
1152
1123
|
this.fetchHandler = this.fetchHandler.bind(this);
|
|
1153
1124
|
Object.assign(this.fetchHandler, { fetchMock: this });
|
|
1154
1125
|
}
|
|
@@ -1173,7 +1144,7 @@ var FetchMock = class FetchMock {
|
|
|
1173
1144
|
return this;
|
|
1174
1145
|
}
|
|
1175
1146
|
defineMatcher(matcher) {
|
|
1176
|
-
|
|
1147
|
+
Route.defineMatcher(matcher);
|
|
1177
1148
|
}
|
|
1178
1149
|
removeRoutes(options) {
|
|
1179
1150
|
this.router.removeRoutes(options);
|
|
@@ -1215,13 +1186,6 @@ var FetchMock = class FetchMock {
|
|
|
1215
1186
|
this.mockGlobal();
|
|
1216
1187
|
return this.spy();
|
|
1217
1188
|
}
|
|
1218
|
-
};
|
|
1219
|
-
const fetchMock = new FetchMock({ ...defaultFetchMockConfig });
|
|
1220
|
-
var FetchMock_default = fetchMock;
|
|
1221
|
-
|
|
1222
|
-
//#endregion
|
|
1223
|
-
//#region ../../node_modules/.pnpm/fetch-mock@12.5.3/node_modules/fetch-mock/dist/esm/index.js
|
|
1224
|
-
var esm_default = FetchMock_default;
|
|
1225
|
-
|
|
1189
|
+
}({ ...defaultFetchMockConfig });
|
|
1226
1190
|
//#endregion
|
|
1227
|
-
export { esm_default };
|
|
1191
|
+
export { esm_default as t };
|
|
@@ -1,24 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import "../
|
|
9
|
-
import "../
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import "../lookup-BMAWLsP2.js";
|
|
13
|
-
import "../inbox-DcJN1cxM.js";
|
|
14
|
-
import { createFederationBuilder } from "../builder-BO61xeXE.js";
|
|
15
|
-
import { test } from "../testing-RPOc_gVG.js";
|
|
16
|
-
import { assertExists } from "../std__assert-X-_kMxKM.js";
|
|
17
|
-
import "../assert_rejects-DiIiJbZn.js";
|
|
18
|
-
import "../assert_is_error-BPGph1Jx.js";
|
|
19
|
-
import "../assert_not_equals-f3m3epl3.js";
|
|
20
|
-
import { assertThrows } from "../assert_throws-BOO88avQ.js";
|
|
21
|
-
|
|
1
|
+
import "@js-temporal/polyfill";
|
|
2
|
+
import "urlpattern-polyfill";
|
|
3
|
+
globalThis.addEventListener = () => {};
|
|
4
|
+
import { C as Person, _ as Note, t as Activity } 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 { a as assertExists } from "../std__assert-2v7gYiZp.mjs";
|
|
8
|
+
import { t as assertThrows } from "../assert_throws-BIL7gChy.mjs";
|
|
9
|
+
import { t as MemoryKvStore } from "../kv-DM1zFCtL.mjs";
|
|
10
|
+
import { n as parseSemVer } from "../semver-CgD82xxg.mjs";
|
|
11
|
+
import { n as createFederationBuilder } from "../builder-CIkAhIGC.mjs";
|
|
22
12
|
//#region src/federation/builder.test.ts
|
|
23
13
|
test("FederationBuilder", async (t) => {
|
|
24
14
|
await t.step("should build a Federation object with registered components", async () => {
|
|
@@ -29,8 +19,7 @@ test("FederationBuilder", async (t) => {
|
|
|
29
19
|
};
|
|
30
20
|
builder.setActorDispatcher("/users/{identifier}", actorDispatcher);
|
|
31
21
|
const inboxListener = (_ctx, _activity) => {};
|
|
32
|
-
|
|
33
|
-
listeners.on(Activity, inboxListener);
|
|
22
|
+
builder.setInboxListeners("/users/{identifier}/inbox").on(Activity, inboxListener);
|
|
34
23
|
const objectDispatcher = (_ctx, _values) => {
|
|
35
24
|
return null;
|
|
36
25
|
};
|
|
@@ -70,8 +59,7 @@ test("FederationBuilder", async (t) => {
|
|
|
70
59
|
assertExists(inboxListeners);
|
|
71
60
|
assertExists(impl.objectCallbacks[Note.typeId.href]);
|
|
72
61
|
assertExists(impl.nodeInfoDispatcher);
|
|
73
|
-
|
|
74
|
-
assertEquals(notePaths, "/notes/123");
|
|
62
|
+
assertEquals(impl.router.build(`object:${Note.typeId.href}`, { id: "123" }), "/notes/123");
|
|
75
63
|
assertEquals(impl.router.build("actor", { identifier: "user1" }), "/users/user1");
|
|
76
64
|
assertEquals(impl.router.build("inbox", { identifier: "user1" }), "/users/user1/inbox");
|
|
77
65
|
await builder.build({ kv });
|
|
@@ -81,8 +69,7 @@ test("FederationBuilder", async (t) => {
|
|
|
81
69
|
const kv = new MemoryKvStore();
|
|
82
70
|
const federation = await builder.build({ kv });
|
|
83
71
|
assertExists(federation);
|
|
84
|
-
|
|
85
|
-
assertEquals(impl.kv, kv);
|
|
72
|
+
assertEquals(federation.kv, kv);
|
|
86
73
|
});
|
|
87
74
|
await t.step("should pass build options correctly", async () => {
|
|
88
75
|
const builder = createFederationBuilder();
|
|
@@ -107,22 +94,19 @@ test("FederationBuilder", async (t) => {
|
|
|
107
94
|
const kv = new MemoryKvStore();
|
|
108
95
|
const federationDefault = await builder.build({ kv });
|
|
109
96
|
assertExists(federationDefault);
|
|
110
|
-
|
|
111
|
-
assertEquals(implDefault.firstKnock, void 0);
|
|
97
|
+
assertEquals(federationDefault.firstKnock, void 0);
|
|
112
98
|
const federationCustom = await builder.build({
|
|
113
99
|
kv,
|
|
114
100
|
firstKnock: "draft-cavage-http-signatures-12"
|
|
115
101
|
});
|
|
116
102
|
assertExists(federationCustom);
|
|
117
|
-
|
|
118
|
-
assertEquals(implCustom.firstKnock, "draft-cavage-http-signatures-12");
|
|
103
|
+
assertEquals(federationCustom.firstKnock, "draft-cavage-http-signatures-12");
|
|
119
104
|
const federationRfc = await builder.build({
|
|
120
105
|
kv,
|
|
121
106
|
firstKnock: "rfc9421"
|
|
122
107
|
});
|
|
123
108
|
assertExists(federationRfc);
|
|
124
|
-
|
|
125
|
-
assertEquals(implRfc.firstKnock, "rfc9421");
|
|
109
|
+
assertEquals(federationRfc.firstKnock, "rfc9421");
|
|
126
110
|
});
|
|
127
111
|
await t.step("should register multiple object dispatchers and verify them", async () => {
|
|
128
112
|
const builder = createFederationBuilder();
|
|
@@ -135,14 +119,11 @@ test("FederationBuilder", async (t) => {
|
|
|
135
119
|
};
|
|
136
120
|
builder.setObjectDispatcher(Note, "/notes/{id}", noteDispatcher);
|
|
137
121
|
builder.setObjectDispatcher(Person, "/people/{id}", personDispatcher);
|
|
138
|
-
const
|
|
139
|
-
const impl = federation;
|
|
122
|
+
const impl = await builder.build({ kv });
|
|
140
123
|
assertExists(impl.objectCallbacks[Note.typeId.href]);
|
|
141
124
|
assertExists(impl.objectCallbacks[Person.typeId.href]);
|
|
142
|
-
|
|
143
|
-
assertEquals(
|
|
144
|
-
const personPath = impl.router.build(`object:${Person.typeId.href}`, { id: "456" });
|
|
145
|
-
assertEquals(personPath, "/people/456");
|
|
125
|
+
assertEquals(impl.router.build(`object:${Note.typeId.href}`, { id: "123" }), "/notes/123");
|
|
126
|
+
assertEquals(impl.router.build(`object:${Person.typeId.href}`, { id: "456" }), "/people/456");
|
|
146
127
|
const noteRoute = impl.router.route("/notes/789");
|
|
147
128
|
assertEquals(noteRoute?.name, `object:${Note.typeId.href}`);
|
|
148
129
|
assertEquals(noteRoute?.values.id, "789");
|
|
@@ -170,5 +151,5 @@ test("FederationBuilder", async (t) => {
|
|
|
170
151
|
builder.setCollectionDispatcher(strId, Note, "/string-id/{id}", dispatcher);
|
|
171
152
|
});
|
|
172
153
|
});
|
|
173
|
-
|
|
174
|
-
|
|
154
|
+
//#endregion
|
|
155
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import "@js-temporal/polyfill";
|
|
2
|
+
import "urlpattern-polyfill";
|
|
3
|
+
globalThis.addEventListener = () => {};
|
|
4
|
+
import { t as test } from "../testing-DS3gcq8V.mjs";
|
|
5
|
+
import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
|
|
6
|
+
import "../std__assert-2v7gYiZp.mjs";
|
|
7
|
+
import { n as digest, t as buildCollectionSynchronizationHeader } from "../collection-BD6-SZ6O.mjs";
|
|
8
|
+
import { decodeHex } from "byte-encodings/hex";
|
|
9
|
+
//#region src/federation/collection.test.ts
|
|
10
|
+
test("digest()", async () => {
|
|
11
|
+
assertEquals(await digest([
|
|
12
|
+
new URL("https://testing.example.org/users/1"),
|
|
13
|
+
new URL("https://testing.example.org/users/2"),
|
|
14
|
+
new URL("https://testing.example.org/users/2")
|
|
15
|
+
]), decodeHex("c33f48cd341ef046a206b8a72ec97af65079f9a3a9b90eef79c5920dce45c61f"));
|
|
16
|
+
});
|
|
17
|
+
test("buildCollectionSynchronizationHeader()", async () => {
|
|
18
|
+
assertEquals(await buildCollectionSynchronizationHeader("https://testing.example.org/users/1/followers", ["https://testing.example.org/users/2", "https://testing.example.org/users/1"]), "collectionId=\"https://testing.example.org/users/1/followers\", url=\"https://testing.example.org/users/1/followers?base-url=https%3A%2F%2Ftesting.example.org%2F\", digest=\"c33f48cd341ef046a206b8a72ec97af65079f9a3a9b90eef79c5920dce45c61f\"");
|
|
19
|
+
});
|
|
20
|
+
//#endregion
|
|
21
|
+
export {};
|