@fedify/fedify 1.10.0-dev.2 → 2.0.0-dev.12
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/README.md +3 -0
- package/dist/{actor-eIATKOh7.js → actor-C-FuEZU4.js} +220 -705
- package/dist/{actor-C1Euqngb.d.ts → actor-DqFajh9s.d.ts} +2 -2
- package/dist/{actor-8zynMl2a.cjs → actor-_9UN5RVT.cjs} +952 -1479
- package/dist/{actor-Ydzhc8dj.d.cts → actor-f2NtjyCg.d.cts} +2 -2
- package/dist/{actor-Bv7llTFW.js → actor-rOm0sXHU.js} +1 -1
- package/dist/{assert_rejects-DiIiJbZn.js → assert_rejects-Ce45JcFg.js} +1 -1
- package/dist/{assert_is_error-BPGph1Jx.js → assert_throws-BNXdRGWP.js} +31 -1
- package/dist/{builder-C7fApQY_.js → builder-hArjoWjW.js} +3 -4
- package/dist/{client-DjT_tegg.d.cts → client-94iWEfQa.d.cts} +3 -75
- package/dist/{client-DF8anIB5.d.ts → client-BsGzbnV-.d.ts} +3 -75
- package/dist/{client-Bwnrdh_A.js → client-pY7-3icS.js} +3 -22
- package/dist/compat/mod.d.cts +10 -12
- package/dist/compat/mod.d.ts +10 -12
- package/dist/compat/transformers.test.js +20 -20
- package/dist/{context-CwUAkopp.d.cts → context-PxGADCsD.d.cts} +152 -27
- package/dist/{context-CXUibY4L.d.ts → context-V-XS2_6O.d.ts} +152 -27
- package/dist/{authdocloader-TNeksncq.js → docloader-CE1lRhEV.js} +17 -8
- package/dist/{esm-aj4vkb76.js → esm-BEFbR5eN.js} +32 -17
- package/dist/federation/builder.test.js +9 -12
- package/dist/federation/collection.test.js +7 -9
- package/dist/federation/handler.test.js +28 -149
- package/dist/federation/idempotency.test.js +26 -27
- package/dist/federation/inbox.test.js +4 -6
- package/dist/federation/keycache.test.js +3 -4
- package/dist/federation/kv.test.js +6 -8
- package/dist/federation/middleware.test.js +270 -93
- package/dist/federation/mod.cjs +9 -11
- package/dist/federation/mod.d.cts +10 -12
- package/dist/federation/mod.d.ts +10 -12
- package/dist/federation/mod.js +9 -11
- package/dist/federation/mq.test.js +10 -10
- package/dist/federation/negotiation.test.js +26 -0
- package/dist/federation/retry.test.js +4 -5
- package/dist/federation/router.test.js +6 -8
- package/dist/federation/send.test.js +14 -16
- package/dist/{http-wsGR6KkT.d.ts → http-BbO0ejuk.d.ts} +2 -2
- package/dist/{http-DXmKLE1t.js → http-Bmx7ea3F.js} +2 -2
- package/dist/{http-B1_DzfAU.d.cts → http-M8k5mKc0.d.cts} +2 -2
- package/dist/{http-DMJrVRf0.js → http-Q_l4fCEE.js} +256 -6
- package/dist/{http-CK80ff9S.cjs → http-So5V_Tgv.cjs} +289 -9
- package/dist/{inbox-Dt-Q2rJt.js → inbox-B9PjFn2S.js} +2 -7
- package/dist/{key-Tt9B2Qkj.js → key-khQpfFdw.js} +3 -2
- package/dist/{keycache-CXF4YAON.js → keycache-BU3fsZFa.js} +1 -1
- package/dist/{keys-CAUbEZtV.js → keys-BaMFfIdL.js} +2 -1
- package/dist/kv-cache-DN9pfMBe.js +94 -0
- package/dist/kv-cache-R1oW382l.js +122 -0
- package/dist/kv-cache-X2ggcnHI.cjs +134 -0
- package/dist/{ld-CqoYKNwB.js → ld-BLMebnep.js} +3 -2
- package/dist/{type-E_91dusN.js → lookup-C7SSHgK7.js} +542 -5394
- package/dist/{lookup-BXlOCJsH.cjs → lookup-CLaDFNx1.cjs} +134 -5
- package/dist/{lookup-8Ik9lSMm.js → lookup-CtC3x1M6.js} +125 -2
- package/dist/middleware-BYBwqvTv.cjs +15 -0
- package/dist/{middleware-DnXc8LK4.js → middleware-Bda2JO66.js} +38 -84
- package/dist/{middleware-nSw7nWf8.js → middleware-C3ml59Hp.js} +43 -146
- package/dist/middleware-DC7h2qq-.js +26 -0
- package/dist/{middleware-bN29Orv5.cjs → middleware-DFLterpx.cjs} +58 -104
- package/dist/middleware-mQR2SM7T.js +15 -0
- package/dist/{mod-CDObsV1d.d.ts → mod-BlVovdcy.d.ts} +2 -2
- package/dist/{mod-mXx9V0q5.d.cts → mod-BoRKfJPE.d.cts} +2 -2
- package/dist/{mod-BUbqxBev.d.cts → mod-BxRCHTz-.d.cts} +2 -2
- package/dist/{mod-jQ4OODsl.d.cts → mod-C58MZ7Wx.d.cts} +1 -1
- package/dist/{mod-BcObK1Lz.d.ts → mod-Cdo6SYlJ.d.ts} +2 -2
- package/dist/{mod-DgcYoyZK.d.ts → mod-D5Z2tISD.d.ts} +3 -3
- package/dist/mod-DMpuiKXi.d.cts +107 -0
- package/dist/{mod-fjqfsrty.d.cts → mod-DgxG-byT.d.cts} +3 -3
- package/dist/{mod-DBzN0aCM.d.ts → mod-Ds0mpFZU.d.ts} +1 -1
- package/dist/mod-aAE2wOWV.d.ts +109 -0
- package/dist/mod.cjs +19 -34
- package/dist/mod.d.cts +15 -17
- package/dist/mod.d.ts +15 -17
- package/dist/mod.js +14 -16
- package/dist/negotiation-C4nFufNk.js +71 -0
- package/dist/nodeinfo/client.test.js +30 -111
- package/dist/nodeinfo/handler.test.js +25 -26
- package/dist/nodeinfo/mod.cjs +3 -6
- package/dist/nodeinfo/mod.d.cts +3 -5
- package/dist/nodeinfo/mod.d.ts +3 -5
- package/dist/nodeinfo/mod.js +3 -4
- package/dist/nodeinfo/types.test.js +8 -15
- package/dist/{owner-6KSEp9eV.d.cts → owner-B4HbyP8s.d.cts} +3 -3
- package/dist/{owner-9jSx_21P.js → owner-XzzTSr4S.js} +3 -2
- package/dist/{owner-BbeUDvOu.d.ts → owner-kQRGVXG1.d.ts} +3 -3
- package/dist/{proof-BT3OPhWQ.js → proof-B-qOSAuQ.js} +5 -4
- package/dist/{proof-BuLnngRI.cjs → proof-BzJkFBBF.cjs} +18 -17
- package/dist/{proof-B5YI7sn5.js → proof-C9sfVit1.js} +2 -2
- package/dist/{send-DlPE7bKe.js → send-yEkZlxzW.js} +2 -2
- package/dist/sig/http.test.js +12 -13
- package/dist/sig/key.test.js +9 -11
- package/dist/sig/ld.test.js +8 -10
- package/dist/sig/mod.cjs +9 -11
- package/dist/sig/mod.d.cts +5 -7
- package/dist/sig/mod.d.ts +5 -7
- package/dist/sig/mod.js +5 -7
- package/dist/sig/owner.test.js +11 -13
- package/dist/sig/proof.test.js +13 -14
- package/dist/src/vocab/accept.yaml +1 -1
- package/dist/src/vocab/activity.yaml +1 -1
- package/dist/src/vocab/add.yaml +1 -1
- package/dist/src/vocab/announce.yaml +1 -1
- package/dist/src/vocab/application.yaml +1 -1
- package/dist/src/vocab/arrive.yaml +1 -1
- package/dist/src/vocab/article.yaml +1 -1
- package/dist/src/vocab/audio.yaml +1 -1
- package/dist/src/vocab/block.yaml +1 -1
- package/dist/src/vocab/chatmessage.yaml +1 -1
- package/dist/src/vocab/collection.yaml +1 -1
- package/dist/src/vocab/collectionpage.yaml +1 -1
- package/dist/src/vocab/create.yaml +1 -1
- package/dist/src/vocab/dataintegrityproof.yaml +1 -1
- package/dist/src/vocab/delete.yaml +1 -1
- package/dist/src/vocab/didservice.yaml +1 -1
- package/dist/src/vocab/dislike.yaml +1 -1
- package/dist/src/vocab/document.yaml +1 -1
- package/dist/src/vocab/emoji.yaml +1 -1
- package/dist/src/vocab/emojireact.yaml +1 -1
- package/dist/src/vocab/endpoints.yaml +1 -1
- package/dist/src/vocab/event.yaml +1 -1
- package/dist/src/vocab/export.yaml +1 -1
- package/dist/src/vocab/flag.yaml +1 -1
- package/dist/src/vocab/follow.yaml +1 -1
- package/dist/src/vocab/group.yaml +1 -1
- package/dist/src/vocab/hashtag.yaml +1 -1
- package/dist/src/vocab/ignore.yaml +1 -1
- package/dist/src/vocab/image.yaml +1 -1
- package/dist/src/vocab/intransitiveactivity.yaml +1 -1
- package/dist/src/vocab/invite.yaml +1 -1
- package/dist/src/vocab/join.yaml +1 -1
- package/dist/src/vocab/key.yaml +1 -1
- package/dist/src/vocab/leave.yaml +1 -1
- package/dist/src/vocab/like.yaml +1 -1
- package/dist/src/vocab/link.yaml +1 -1
- package/dist/src/vocab/listen.yaml +1 -1
- package/dist/src/vocab/mention.yaml +1 -1
- package/dist/src/vocab/move.yaml +1 -1
- package/dist/src/vocab/multikey.yaml +1 -1
- package/dist/src/vocab/note.yaml +1 -1
- package/dist/src/vocab/object.yaml +1 -1
- package/dist/src/vocab/offer.yaml +1 -1
- package/dist/src/vocab/orderedcollection.yaml +1 -1
- package/dist/src/vocab/orderedcollectionpage.yaml +1 -1
- package/dist/src/vocab/organization.yaml +1 -1
- package/dist/src/vocab/page.yaml +1 -1
- package/dist/src/vocab/person.yaml +1 -1
- package/dist/src/vocab/place.yaml +1 -1
- package/dist/src/vocab/profile.yaml +1 -1
- package/dist/src/vocab/propertyvalue.yaml +1 -1
- package/dist/src/vocab/question.yaml +1 -1
- package/dist/src/vocab/read.yaml +1 -1
- package/dist/src/vocab/reject.yaml +1 -1
- package/dist/src/vocab/relationship.yaml +1 -1
- package/dist/src/vocab/remove.yaml +1 -1
- package/dist/src/vocab/service.yaml +1 -1
- package/dist/src/vocab/source.yaml +1 -1
- package/dist/src/vocab/tentativeaccept.yaml +1 -1
- package/dist/src/vocab/tentativereject.yaml +1 -1
- package/dist/src/vocab/tombstone.yaml +1 -1
- package/dist/src/vocab/travel.yaml +1 -1
- package/dist/src/vocab/undo.yaml +1 -1
- package/dist/src/vocab/update.yaml +1 -1
- package/dist/src/vocab/video.yaml +1 -1
- package/dist/src/vocab/view.yaml +1 -1
- package/dist/testing/docloader.test.js +6 -8
- package/dist/testing/mod.d.ts +10 -119
- package/dist/testing/mod.js +2 -3
- package/dist/{testing-B17zODFD.js → testing-D-nLIHkh.js} +1 -2
- package/dist/{types-By5LByL1.js → types-BtUjyi5y.js} +5 -166
- package/dist/{types-BIgY6c-l.js → types-C2XVl6gj.js} +1 -3
- package/dist/{types-Ci8XKEfO.cjs → types-CWgzGaqk.cjs} +6 -179
- package/dist/{runtime/authdocloader.test.js → utils/docloader.test.js} +14 -15
- package/dist/utils/kv-cache.test.js +209 -0
- package/dist/utils/mod.cjs +12 -0
- package/dist/utils/mod.d.cts +5 -0
- package/dist/utils/mod.d.ts +7 -0
- package/dist/utils/mod.js +11 -0
- package/dist/vocab/actor.test.js +8 -10
- package/dist/vocab/lookup.test.js +8 -10
- package/dist/vocab/mod.cjs +3 -4
- package/dist/vocab/mod.d.cts +3 -5
- package/dist/vocab/mod.d.ts +3 -5
- package/dist/vocab/mod.js +3 -4
- package/dist/vocab/type.test.js +2 -3
- package/dist/vocab/vocab.test.js +7618 -1973
- package/dist/{vocab-CDHNj5zp.d.ts → vocab-BCWe1Ih5.d.ts} +9 -25
- package/dist/{vocab-BjnZ49Xt.cjs → vocab-C96aggZM.cjs} +5 -5
- package/dist/{vocab-Cfs0937i.d.cts → vocab-CeDBzu-f.d.cts} +9 -25
- package/dist/{vocab-CthegyUc.js → vocab-axlR_8k0.js} +3 -3
- package/dist/webfinger/handler.test.js +24 -25
- package/dist/webfinger/lookup.test.js +7 -9
- package/dist/webfinger/mod.cjs +2 -3
- package/dist/webfinger/mod.d.cts +1 -3
- package/dist/webfinger/mod.d.ts +1 -3
- package/dist/webfinger/mod.js +2 -3
- package/package.json +20 -51
- package/dist/assert_throws-BOO88avQ.js +0 -39
- package/dist/authdocloader-BEPeTSD8.cjs +0 -58
- package/dist/authdocloader-BNIyrORx.js +0 -52
- package/dist/denokv-D0nfNQ1x.js +0 -57
- package/dist/docloader-CLYexeNv.js +0 -4825
- package/dist/docloader-CdsuyjrU.cjs +0 -4891
- package/dist/docloader-CxWcuWqQ.d.ts +0 -221
- package/dist/docloader-D-MrRyHl.d.cts +0 -219
- package/dist/key-BL8DRhuI.js +0 -10
- package/dist/key-BU1Vsq8S.cjs +0 -290
- package/dist/key-DTzAk78O.js +0 -10
- package/dist/key-DWDJFZzD.js +0 -260
- package/dist/key-gZEWdYwT.cjs +0 -10
- package/dist/lookup-Co4Y1ycg.js +0 -336
- package/dist/middleware-09gZVY21.cjs +0 -17
- package/dist/middleware-B8Q9c1ys.js +0 -26
- package/dist/middleware-DHUCp8iq.js +0 -17
- package/dist/mod-CIbqfZW0.d.ts +0 -104
- package/dist/mod-Dt-G9ZOS.d.cts +0 -102
- package/dist/mq-B7R1Q-M5.d.cts +0 -140
- package/dist/mq-CRGm1e_F.d.ts +0 -143
- package/dist/nodeinfo/semver.test.js +0 -143
- package/dist/runtime/docloader.test.js +0 -588
- package/dist/runtime/key.test.d.ts +0 -3
- package/dist/runtime/key.test.js +0 -103
- package/dist/runtime/langstr.test.d.ts +0 -3
- package/dist/runtime/langstr.test.js +0 -40
- package/dist/runtime/link.test.d.ts +0 -3
- package/dist/runtime/link.test.js +0 -61
- package/dist/runtime/mod.cjs +0 -25
- package/dist/runtime/mod.d.cts +0 -6
- package/dist/runtime/mod.d.ts +0 -8
- package/dist/runtime/mod.js +0 -13
- package/dist/runtime/multibase/multibase.test.d.ts +0 -3
- package/dist/runtime/multibase/multibase.test.js +0 -358
- package/dist/runtime/url.test.d.ts +0 -3
- package/dist/runtime/url.test.js +0 -45
- package/dist/semver-dArNLkR9.js +0 -149
- package/dist/vocab/schema.yaml +0 -247
- package/dist/x/cfworkers.cjs +0 -100
- package/dist/x/cfworkers.d.cts +0 -59
- package/dist/x/cfworkers.d.ts +0 -61
- package/dist/x/cfworkers.js +0 -98
- package/dist/x/cfworkers.test.d.ts +0 -3
- package/dist/x/cfworkers.test.js +0 -179
- package/dist/x/hono.cjs +0 -61
- package/dist/x/hono.d.cts +0 -54
- package/dist/x/hono.d.ts +0 -56
- package/dist/x/hono.js +0 -60
- package/dist/x/sveltekit.cjs +0 -69
- package/dist/x/sveltekit.d.cts +0 -46
- package/dist/x/sveltekit.d.ts +0 -48
- package/dist/x/sveltekit.js +0 -68
- /package/dist/{assert_not_equals-f3m3epl3.js → assert_not_equals-C80BG-_5.js} +0 -0
- /package/dist/{collection-CSzG2j1P.js → collection-BzWsN9pB.js} +0 -0
- /package/dist/{nodeinfo/semver.test.d.ts → federation/negotiation.test.d.ts} +0 -0
- /package/dist/{federation-H2_En3j5.cjs → federation-CRpdnOMS.cjs} +0 -0
- /package/dist/{federation-D1U8YY9t.js → federation-jcR8-ZxP.js} +0 -0
- /package/dist/{kv-C7sopW2E.d.ts → kv-BKNZ-Tb-.d.ts} +0 -0
- /package/dist/{kv-63Cil1MD.d.cts → kv-Bxr0Q87_.d.cts} +0 -0
- /package/dist/{mod-C2tOeRkN.d.cts → mod-B-hUPT2N.d.cts} +0 -0
- /package/dist/{mod-1pDWKvUL.d.ts → mod-CVgZgliM.d.ts} +0 -0
- /package/dist/{mod-FZd39qVq.d.cts → mod-CcDPcLJW.d.cts} +0 -0
- /package/dist/{mod-g0xFzAP9.d.ts → mod-bjzj5QIb.d.ts} +0 -0
- /package/dist/{nodeinfo-DfycQ8Wf.js → nodeinfo-BnthBobC.js} +0 -0
- /package/dist/{nodeinfo-Co9lJrWl.cjs → nodeinfo-CdN0rEnZ.cjs} +0 -0
- /package/dist/{otel-Chy5T2Xh.js → otel-1BmGPuZc.js} +0 -0
- /package/dist/{retry-D4GJ670a.js → retry-CfF8Gn4d.js} +0 -0
- /package/dist/{runtime-DPYEDf-o.js → sig-C34-oHBl.js} +0 -0
- /package/dist/{runtime-C58AJWSv.cjs → sig-YYj5tCnr.cjs} +0 -0
- /package/dist/{std__assert-X-_kMxKM.js → std__assert-DWivtrGR.js} +0 -0
- /package/dist/{runtime → utils}/docloader.test.d.ts +0 -0
- /package/dist/{runtime/authdocloader.test.d.ts → utils/kv-cache.test.d.ts} +0 -0
- /package/dist/{sig-Cj3tk-ig.js → utils-D-Va7aXC.js} +0 -0
- /package/dist/{sig-ByHXzqUi.cjs → utils-DyRU1gdZ.cjs} +0 -0
- /package/dist/{webfinger-De_bU0iE.js → webfinger-C72Y8lrh.js} +0 -0
- /package/dist/{webfinger-BjOEdFPs.cjs → webfinger-vAtLmxOF.cjs} +0 -0
|
@@ -3,152 +3,9 @@
|
|
|
3
3
|
const { URLPattern } = require("urlpattern-polyfill");
|
|
4
4
|
|
|
5
5
|
const require_chunk = require('./chunk-DqRYRqnO.cjs');
|
|
6
|
-
const require_docloader = require('./docloader-CdsuyjrU.cjs');
|
|
7
6
|
const __logtape_logtape = require_chunk.__toESM(require("@logtape/logtape"));
|
|
7
|
+
const __fedify_vocab_runtime = require_chunk.__toESM(require("@fedify/vocab-runtime"));
|
|
8
8
|
|
|
9
|
-
//#region src/nodeinfo/semver.ts
|
|
10
|
-
const MAX_LENGTH = 256;
|
|
11
|
-
/**
|
|
12
|
-
* A single `0`, or a non-zero digit followed by zero or more digits.
|
|
13
|
-
*/
|
|
14
|
-
const NUMERIC_IDENTIFIER = "0|[1-9]\\d*";
|
|
15
|
-
/**
|
|
16
|
-
* Zero or more digits, followed by a letter or hyphen, and then zero or more letters, digits, or hyphens.
|
|
17
|
-
*/
|
|
18
|
-
const NON_NUMERIC_IDENTIFIER = "\\d*[a-zA-Z-][a-zA-Z0-9-]*";
|
|
19
|
-
/**
|
|
20
|
-
* Three dot-separated numeric identifiers.
|
|
21
|
-
*/
|
|
22
|
-
const VERSION_CORE = `(?<major>${NUMERIC_IDENTIFIER})\\.(?<minor>${NUMERIC_IDENTIFIER})\\.(?<patch>${NUMERIC_IDENTIFIER})`;
|
|
23
|
-
/**
|
|
24
|
-
* A numeric identifier, or a non-numeric identifier.
|
|
25
|
-
*/
|
|
26
|
-
const PRERELEASE_IDENTIFIER = `(?:${NUMERIC_IDENTIFIER}|${NON_NUMERIC_IDENTIFIER})`;
|
|
27
|
-
/**
|
|
28
|
-
* A hyphen, followed by one or more dot-separated pre-release version identifiers.
|
|
29
|
-
* @example "-pre.release"
|
|
30
|
-
*/
|
|
31
|
-
const PRERELEASE = `(?:-(?<prerelease>${PRERELEASE_IDENTIFIER}(?:\\.${PRERELEASE_IDENTIFIER})*))`;
|
|
32
|
-
/**
|
|
33
|
-
* Any combination of digits, letters, or hyphens.
|
|
34
|
-
*/
|
|
35
|
-
const BUILD_IDENTIFIER = "[0-9A-Za-z-]+";
|
|
36
|
-
/**
|
|
37
|
-
* A plus sign, followed by one or more period-separated build metadata identifiers.
|
|
38
|
-
* @example "+build.meta"
|
|
39
|
-
*/
|
|
40
|
-
const BUILD = `(?:\\+(?<buildmetadata>${BUILD_IDENTIFIER}(?:\\.${BUILD_IDENTIFIER})*))`;
|
|
41
|
-
/**
|
|
42
|
-
* A version, followed optionally by a pre-release version and build metadata.
|
|
43
|
-
*/
|
|
44
|
-
const FULL_VERSION = `v?${VERSION_CORE}${PRERELEASE}?${BUILD}?`;
|
|
45
|
-
const FULL_REGEXP = /* @__PURE__ */ new RegExp(`^${FULL_VERSION}$`);
|
|
46
|
-
/**
|
|
47
|
-
* Attempt to parse a string as a semantic version, returning a SemVer object.
|
|
48
|
-
*
|
|
49
|
-
* @example Usage
|
|
50
|
-
* ```ts
|
|
51
|
-
* import { parseSemVer } from "@fedify/fedify/nodeinfo";
|
|
52
|
-
* import { assertEquals } from "@std/assert";
|
|
53
|
-
*
|
|
54
|
-
* const version = parseSemVer("1.2.3");
|
|
55
|
-
* assertEquals(version, {
|
|
56
|
-
* major: 1,
|
|
57
|
-
* minor: 2,
|
|
58
|
-
* patch: 3,
|
|
59
|
-
* prerelease: [],
|
|
60
|
-
* build: [],
|
|
61
|
-
* });
|
|
62
|
-
* ```
|
|
63
|
-
*
|
|
64
|
-
* @throws {TypeError} If the input string is invalid.
|
|
65
|
-
* @param value The version string to parse
|
|
66
|
-
* @returns A valid SemVer
|
|
67
|
-
* @since 1.2.0
|
|
68
|
-
*/
|
|
69
|
-
function parseSemVer(value) {
|
|
70
|
-
if (typeof value !== "string") throw new TypeError(`Cannot parse version as version must be a string: received ${typeof value}`);
|
|
71
|
-
if (value.length > MAX_LENGTH) throw new TypeError(`Cannot parse version as version length is too long: length is ${value.length}, max length is ${MAX_LENGTH}`);
|
|
72
|
-
value = value.trim();
|
|
73
|
-
const groups = value.match(FULL_REGEXP)?.groups;
|
|
74
|
-
if (!groups) throw new TypeError(`Cannot parse version: ${value}`);
|
|
75
|
-
const major = parseNumber(groups.major, `Cannot parse version ${value}: invalid major version`);
|
|
76
|
-
const minor = parseNumber(groups.minor, `Cannot parse version ${value}: invalid minor version`);
|
|
77
|
-
const patch = parseNumber(groups.patch, `Cannot parse version ${value}: invalid patch version`);
|
|
78
|
-
const prerelease = groups.prerelease ? parsePrerelease(groups.prerelease) : [];
|
|
79
|
-
const build = groups.buildmetadata ? parseBuild(groups.buildmetadata) : [];
|
|
80
|
-
return {
|
|
81
|
-
major,
|
|
82
|
-
minor,
|
|
83
|
-
patch,
|
|
84
|
-
prerelease,
|
|
85
|
-
build
|
|
86
|
-
};
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* Returns true if the value is a valid SemVer number.
|
|
90
|
-
*
|
|
91
|
-
* Must be a number. Must not be NaN. Can be positive or negative infinity.
|
|
92
|
-
* Can be between 0 and MAX_SAFE_INTEGER.
|
|
93
|
-
* @param value The value to check
|
|
94
|
-
* @returns True if its a valid semver number
|
|
95
|
-
*/
|
|
96
|
-
function isValidNumber(value) {
|
|
97
|
-
return typeof value === "number" && !Number.isNaN(value) && (!Number.isFinite(value) || 0 <= value && value <= Number.MAX_SAFE_INTEGER);
|
|
98
|
-
}
|
|
99
|
-
const NUMERIC_IDENTIFIER_REGEXP = /* @__PURE__ */ new RegExp(`^${NUMERIC_IDENTIFIER}$`);
|
|
100
|
-
function parsePrerelease(prerelease) {
|
|
101
|
-
return prerelease.split(".").filter(Boolean).map((id) => {
|
|
102
|
-
if (NUMERIC_IDENTIFIER_REGEXP.test(id)) {
|
|
103
|
-
const number = Number(id);
|
|
104
|
-
if (isValidNumber(number)) return number;
|
|
105
|
-
}
|
|
106
|
-
return id;
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
|
-
function parseBuild(buildmetadata) {
|
|
110
|
-
return buildmetadata.split(".").filter(Boolean);
|
|
111
|
-
}
|
|
112
|
-
function parseNumber(input, errorMessage) {
|
|
113
|
-
const number = Number(input);
|
|
114
|
-
if (!isValidNumber(number)) throw new TypeError(errorMessage);
|
|
115
|
-
return number;
|
|
116
|
-
}
|
|
117
|
-
function formatNumber(value) {
|
|
118
|
-
return value.toFixed(0);
|
|
119
|
-
}
|
|
120
|
-
/**
|
|
121
|
-
* Format a SemVer object into a string.
|
|
122
|
-
*
|
|
123
|
-
* @example Usage
|
|
124
|
-
* ```ts
|
|
125
|
-
* import { formatSemVer } from "@fedify/fedify/nodeinfo";
|
|
126
|
-
* import { assertEquals } from "@std/assert";
|
|
127
|
-
*
|
|
128
|
-
* const semver = {
|
|
129
|
-
* major: 1,
|
|
130
|
-
* minor: 2,
|
|
131
|
-
* patch: 3,
|
|
132
|
-
* };
|
|
133
|
-
* assertEquals(formatSemVer(semver), "1.2.3");
|
|
134
|
-
* ```
|
|
135
|
-
*
|
|
136
|
-
* @param version The SemVer to format
|
|
137
|
-
* @returns The string representation of a semantic version.
|
|
138
|
-
* @since 1.2.0
|
|
139
|
-
*/
|
|
140
|
-
function formatSemVer(version) {
|
|
141
|
-
const major = formatNumber(version.major);
|
|
142
|
-
const minor = formatNumber(version.minor);
|
|
143
|
-
const patch = formatNumber(version.patch);
|
|
144
|
-
const pre = version.prerelease?.join(".") ?? "";
|
|
145
|
-
const build = version.build?.join(".") ?? "";
|
|
146
|
-
const primary = `${major}.${minor}.${patch}`;
|
|
147
|
-
const release = [primary, pre].filter((v) => v).join("-");
|
|
148
|
-
return [release, build].filter((v) => v).join("+");
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
//#endregion
|
|
152
9
|
//#region src/nodeinfo/client.ts
|
|
153
10
|
const logger = (0, __logtape_logtape.getLogger)([
|
|
154
11
|
"fedify",
|
|
@@ -162,7 +19,7 @@ async function getNodeInfo(url, options = {}) {
|
|
|
162
19
|
const wellKnownUrl = new URL("/.well-known/nodeinfo", url);
|
|
163
20
|
const wellKnownResponse = await fetch(wellKnownUrl, { headers: {
|
|
164
21
|
Accept: "application/json",
|
|
165
|
-
"User-Agent": typeof options.userAgent === "string" ? options.userAgent :
|
|
22
|
+
"User-Agent": typeof options.userAgent === "string" ? options.userAgent : (0, __fedify_vocab_runtime.getUserAgent)(options.userAgent)
|
|
166
23
|
} });
|
|
167
24
|
if (!wellKnownResponse.ok) {
|
|
168
25
|
logger.error("Failed to fetch {url}: {status} {statusText}", {
|
|
@@ -185,7 +42,7 @@ async function getNodeInfo(url, options = {}) {
|
|
|
185
42
|
}
|
|
186
43
|
const response = await fetch(nodeInfoUrl, { headers: {
|
|
187
44
|
Accept: "application/json",
|
|
188
|
-
"User-Agent": typeof options.userAgent === "string" ? options.userAgent :
|
|
45
|
+
"User-Agent": typeof options.userAgent === "string" ? options.userAgent : (0, __fedify_vocab_runtime.getUserAgent)(options.userAgent)
|
|
189
46
|
} });
|
|
190
47
|
if (!response.ok) {
|
|
191
48
|
logger.error("Failed to fetch NodeInfo document from {url}: {status} {statusText}", {
|
|
@@ -275,28 +132,10 @@ function parseSoftware(data, options = {}) {
|
|
|
275
132
|
name = data.name.trim().toLowerCase();
|
|
276
133
|
} else return null;
|
|
277
134
|
let version;
|
|
278
|
-
if ("version" in data
|
|
279
|
-
version = parseSemVer(data.version);
|
|
280
|
-
} catch {
|
|
281
|
-
if (!options.tryBestEffort) return null;
|
|
282
|
-
const parts = data.version.split(".").map((p) => parseInt(p, 10));
|
|
283
|
-
version = {
|
|
284
|
-
major: !isNaN(parts[0]) ? parts[0] : 0,
|
|
285
|
-
minor: !isNaN(parts[1]) ? parts[1] : 0,
|
|
286
|
-
patch: !isNaN(parts[2]) ? parts[2] : 0,
|
|
287
|
-
build: [],
|
|
288
|
-
prerelease: []
|
|
289
|
-
};
|
|
290
|
-
}
|
|
135
|
+
if ("version" in data) version = String(data.version);
|
|
291
136
|
else {
|
|
292
137
|
if (!options.tryBestEffort) return null;
|
|
293
|
-
version =
|
|
294
|
-
major: 0,
|
|
295
|
-
minor: 0,
|
|
296
|
-
patch: 0,
|
|
297
|
-
build: [],
|
|
298
|
-
prerelease: []
|
|
299
|
-
};
|
|
138
|
+
version = "0.0.0";
|
|
300
139
|
}
|
|
301
140
|
let repository;
|
|
302
141
|
if ("repository" in data) {
|
|
@@ -433,7 +272,7 @@ function nodeInfoToJson(nodeInfo) {
|
|
|
433
272
|
version: "2.1",
|
|
434
273
|
software: {
|
|
435
274
|
name: nodeInfo.software.name,
|
|
436
|
-
version:
|
|
275
|
+
version: nodeInfo.software.version,
|
|
437
276
|
repository: nodeInfo.software.repository?.href,
|
|
438
277
|
homepage: nodeInfo.software.homepage?.href
|
|
439
278
|
},
|
|
@@ -456,12 +295,6 @@ function nodeInfoToJson(nodeInfo) {
|
|
|
456
295
|
}
|
|
457
296
|
|
|
458
297
|
//#endregion
|
|
459
|
-
Object.defineProperty(exports, 'formatSemVer', {
|
|
460
|
-
enumerable: true,
|
|
461
|
-
get: function () {
|
|
462
|
-
return formatSemVer;
|
|
463
|
-
}
|
|
464
|
-
});
|
|
465
298
|
Object.defineProperty(exports, 'getNodeInfo', {
|
|
466
299
|
enumerable: true,
|
|
467
300
|
get: function () {
|
|
@@ -479,10 +312,4 @@ Object.defineProperty(exports, 'parseNodeInfo', {
|
|
|
479
312
|
get: function () {
|
|
480
313
|
return parseNodeInfo;
|
|
481
314
|
}
|
|
482
|
-
});
|
|
483
|
-
Object.defineProperty(exports, 'parseSemVer', {
|
|
484
|
-
enumerable: true,
|
|
485
|
-
get: function () {
|
|
486
|
-
return parseSemVer;
|
|
487
|
-
}
|
|
488
315
|
});
|
|
@@ -3,25 +3,24 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import
|
|
6
|
+
import "../lookup-C7SSHgK7.js";
|
|
7
7
|
import { assertEquals } from "../assert_equals-DSbWqCm3.js";
|
|
8
8
|
import "../assert-MZs1qjMx.js";
|
|
9
9
|
import "../assert_instance_of-DHz7EHNU.js";
|
|
10
|
-
import "../
|
|
11
|
-
import "../
|
|
12
|
-
import "../
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import
|
|
16
|
-
import "../
|
|
17
|
-
import
|
|
18
|
-
import "../
|
|
19
|
-
import "../
|
|
20
|
-
import "../
|
|
21
|
-
import {
|
|
22
|
-
import { esm_default } from "../esm-aj4vkb76.js";
|
|
10
|
+
import "../actor-rOm0sXHU.js";
|
|
11
|
+
import "../key-khQpfFdw.js";
|
|
12
|
+
import { verifyRequest } from "../http-Bmx7ea3F.js";
|
|
13
|
+
import { getAuthenticatedDocumentLoader } from "../docloader-CE1lRhEV.js";
|
|
14
|
+
import { mockDocumentLoader, test } from "../testing-D-nLIHkh.js";
|
|
15
|
+
import "../std__assert-DWivtrGR.js";
|
|
16
|
+
import { assertRejects } from "../assert_rejects-Ce45JcFg.js";
|
|
17
|
+
import "../assert_throws-BNXdRGWP.js";
|
|
18
|
+
import "../assert_not_equals-C80BG-_5.js";
|
|
19
|
+
import { rsaPrivateKey2 } from "../keys-BaMFfIdL.js";
|
|
20
|
+
import { esm_default } from "../esm-BEFbR5eN.js";
|
|
21
|
+
import { UrlError } from "@fedify/vocab-runtime";
|
|
23
22
|
|
|
24
|
-
//#region src/
|
|
23
|
+
//#region src/utils/docloader.test.ts
|
|
25
24
|
test("getAuthenticatedDocumentLoader()", async (t) => {
|
|
26
25
|
esm_default.spyGlobal();
|
|
27
26
|
esm_default.get("begin:https://example.com/object", async (cl) => {
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
|
|
2
|
+
import { Temporal } from "@js-temporal/polyfill";
|
|
3
|
+
import { URLPattern } from "urlpattern-polyfill";
|
|
4
|
+
globalThis.addEventListener = () => {};
|
|
5
|
+
|
|
6
|
+
import "../lookup-C7SSHgK7.js";
|
|
7
|
+
import { MockKvStore, kvCache } from "../kv-cache-DN9pfMBe.js";
|
|
8
|
+
import { mockDocumentLoader, test } from "../testing-D-nLIHkh.js";
|
|
9
|
+
import { preloadedContexts } from "@fedify/vocab-runtime";
|
|
10
|
+
import { deepStrictEqual, throws } from "node:assert";
|
|
11
|
+
|
|
12
|
+
//#region src/utils/kv-cache.test.ts
|
|
13
|
+
test("kvCache()", async (t) => {
|
|
14
|
+
const kv = new MockKvStore();
|
|
15
|
+
await t.step("cached", async () => {
|
|
16
|
+
const loader = kvCache({
|
|
17
|
+
kv,
|
|
18
|
+
loader: mockDocumentLoader,
|
|
19
|
+
rules: [
|
|
20
|
+
["https://example.org/", Temporal.Duration.from({ days: 1 })],
|
|
21
|
+
[new URL("https://example.net/"), Temporal.Duration.from({ days: 1 })],
|
|
22
|
+
[new URLPattern("https://example.com/*"), Temporal.Duration.from({ days: 30 })]
|
|
23
|
+
],
|
|
24
|
+
prefix: ["_test", "cached"]
|
|
25
|
+
});
|
|
26
|
+
const result = await loader("https://example.com/object");
|
|
27
|
+
deepStrictEqual(result, {
|
|
28
|
+
contextUrl: null,
|
|
29
|
+
documentUrl: "https://example.com/object",
|
|
30
|
+
document: {
|
|
31
|
+
"@context": "https://www.w3.org/ns/activitystreams",
|
|
32
|
+
id: "https://example.com/object",
|
|
33
|
+
name: "Fetched object",
|
|
34
|
+
type: "Object"
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
const cache = await kv.get([
|
|
38
|
+
"_test",
|
|
39
|
+
"cached",
|
|
40
|
+
"https://example.com/object"
|
|
41
|
+
]);
|
|
42
|
+
deepStrictEqual(cache, result);
|
|
43
|
+
await kv.set([
|
|
44
|
+
"_test",
|
|
45
|
+
"cached",
|
|
46
|
+
"https://example.org/"
|
|
47
|
+
], {
|
|
48
|
+
contextUrl: null,
|
|
49
|
+
documentUrl: "https://example.org/",
|
|
50
|
+
document: { "id": "https://example.org/" }
|
|
51
|
+
});
|
|
52
|
+
const result2 = await loader("https://example.org/");
|
|
53
|
+
deepStrictEqual(result2, {
|
|
54
|
+
contextUrl: null,
|
|
55
|
+
documentUrl: "https://example.org/",
|
|
56
|
+
document: { "id": "https://example.org/" }
|
|
57
|
+
});
|
|
58
|
+
await kv.set([
|
|
59
|
+
"_test",
|
|
60
|
+
"cached",
|
|
61
|
+
"https://example.net/"
|
|
62
|
+
], {
|
|
63
|
+
contextUrl: null,
|
|
64
|
+
documentUrl: "https://example.net/",
|
|
65
|
+
document: { "id": "https://example.net/" }
|
|
66
|
+
});
|
|
67
|
+
const result3 = await loader("https://example.net/");
|
|
68
|
+
deepStrictEqual(result3, {
|
|
69
|
+
contextUrl: null,
|
|
70
|
+
documentUrl: "https://example.net/",
|
|
71
|
+
document: { "id": "https://example.net/" }
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
await t.step("not cached", async () => {
|
|
75
|
+
const loader = kvCache({
|
|
76
|
+
kv,
|
|
77
|
+
loader: mockDocumentLoader,
|
|
78
|
+
rules: [],
|
|
79
|
+
prefix: ["_test", "not cached"]
|
|
80
|
+
});
|
|
81
|
+
const result = await loader("https://example.com/object");
|
|
82
|
+
deepStrictEqual(result, {
|
|
83
|
+
contextUrl: null,
|
|
84
|
+
documentUrl: "https://example.com/object",
|
|
85
|
+
document: {
|
|
86
|
+
"@context": "https://www.w3.org/ns/activitystreams",
|
|
87
|
+
id: "https://example.com/object",
|
|
88
|
+
name: "Fetched object",
|
|
89
|
+
type: "Object"
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
const cache = await kv.get([
|
|
93
|
+
"test2",
|
|
94
|
+
"not cached",
|
|
95
|
+
"https://example.com/object"
|
|
96
|
+
]);
|
|
97
|
+
deepStrictEqual(cache, void 0);
|
|
98
|
+
});
|
|
99
|
+
await t.step("maximum cache duration", () => {
|
|
100
|
+
throws(() => kvCache({
|
|
101
|
+
kv,
|
|
102
|
+
loader: mockDocumentLoader,
|
|
103
|
+
rules: [["https://example.com/", Temporal.Duration.from({
|
|
104
|
+
days: 30,
|
|
105
|
+
seconds: 1
|
|
106
|
+
})]]
|
|
107
|
+
}), TypeError, "The maximum cache duration is 30 days");
|
|
108
|
+
throws(() => kvCache({
|
|
109
|
+
kv,
|
|
110
|
+
loader: mockDocumentLoader,
|
|
111
|
+
rules: [[new URLPattern("https://example.com/*"), Temporal.Duration.from({
|
|
112
|
+
days: 30,
|
|
113
|
+
seconds: 1
|
|
114
|
+
})]]
|
|
115
|
+
}), TypeError, "The maximum cache duration is 30 days");
|
|
116
|
+
});
|
|
117
|
+
await t.step("on kv store exception", async () => {
|
|
118
|
+
class KvStoreThrowsException {
|
|
119
|
+
get(_key) {
|
|
120
|
+
throw new Error("Failed to get key");
|
|
121
|
+
}
|
|
122
|
+
set(_key, _value, _options) {
|
|
123
|
+
throw new Error("Failed to set key");
|
|
124
|
+
}
|
|
125
|
+
delete(_key) {
|
|
126
|
+
throw new Error("Failed to delete key");
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
const loader = kvCache({
|
|
130
|
+
kv: new KvStoreThrowsException(),
|
|
131
|
+
loader: mockDocumentLoader,
|
|
132
|
+
rules: [
|
|
133
|
+
["https://example.org/", Temporal.Duration.from({ days: 1 })],
|
|
134
|
+
[new URL("https://example.net/"), Temporal.Duration.from({ days: 1 })],
|
|
135
|
+
[new URLPattern("https://example.com/*"), Temporal.Duration.from({ days: 30 })]
|
|
136
|
+
],
|
|
137
|
+
prefix: ["_test", "not cached"]
|
|
138
|
+
});
|
|
139
|
+
const result = await loader("https://example.com/object");
|
|
140
|
+
deepStrictEqual(result, {
|
|
141
|
+
contextUrl: null,
|
|
142
|
+
documentUrl: "https://example.com/object",
|
|
143
|
+
document: {
|
|
144
|
+
"@context": "https://www.w3.org/ns/activitystreams",
|
|
145
|
+
id: "https://example.com/object",
|
|
146
|
+
name: "Fetched object",
|
|
147
|
+
type: "Object"
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
});
|
|
151
|
+
await t.step("preloaded contexts bypass cache", async () => {
|
|
152
|
+
const kv$1 = new MockKvStore();
|
|
153
|
+
let loaderCalled = false;
|
|
154
|
+
const mockLoader = (url) => {
|
|
155
|
+
loaderCalled = true;
|
|
156
|
+
return Promise.resolve({
|
|
157
|
+
contextUrl: null,
|
|
158
|
+
documentUrl: url,
|
|
159
|
+
document: { "mock": "document" }
|
|
160
|
+
});
|
|
161
|
+
};
|
|
162
|
+
const loader = kvCache({
|
|
163
|
+
kv: kv$1,
|
|
164
|
+
loader: mockLoader,
|
|
165
|
+
prefix: ["_test", "preloaded"]
|
|
166
|
+
});
|
|
167
|
+
const activityStreamsUrl = "https://www.w3.org/ns/activitystreams";
|
|
168
|
+
loaderCalled = false;
|
|
169
|
+
const result = await loader(activityStreamsUrl);
|
|
170
|
+
deepStrictEqual(result, {
|
|
171
|
+
contextUrl: null,
|
|
172
|
+
documentUrl: activityStreamsUrl,
|
|
173
|
+
document: preloadedContexts[activityStreamsUrl]
|
|
174
|
+
});
|
|
175
|
+
deepStrictEqual(loaderCalled, false, "Loader should not be called for preloaded contexts");
|
|
176
|
+
const cachedValue = await kv$1.get([
|
|
177
|
+
"_test",
|
|
178
|
+
"preloaded",
|
|
179
|
+
activityStreamsUrl
|
|
180
|
+
]);
|
|
181
|
+
deepStrictEqual(cachedValue, void 0, "Preloaded contexts should not be cached in KV store");
|
|
182
|
+
const securityUrl = "https://w3id.org/security/v1";
|
|
183
|
+
loaderCalled = false;
|
|
184
|
+
const result2 = await loader(securityUrl);
|
|
185
|
+
deepStrictEqual(result2, {
|
|
186
|
+
contextUrl: null,
|
|
187
|
+
documentUrl: securityUrl,
|
|
188
|
+
document: preloadedContexts[securityUrl]
|
|
189
|
+
});
|
|
190
|
+
deepStrictEqual(loaderCalled, false, "Loader should not be called for preloaded contexts");
|
|
191
|
+
const nonPreloadedUrl = "https://example.com/not-preloaded";
|
|
192
|
+
loaderCalled = false;
|
|
193
|
+
const result3 = await loader(nonPreloadedUrl);
|
|
194
|
+
deepStrictEqual(result3, {
|
|
195
|
+
contextUrl: null,
|
|
196
|
+
documentUrl: nonPreloadedUrl,
|
|
197
|
+
document: { "mock": "document" }
|
|
198
|
+
});
|
|
199
|
+
deepStrictEqual(loaderCalled, true, "Loader should be called for non-preloaded URLs");
|
|
200
|
+
const cachedValue2 = await kv$1.get([
|
|
201
|
+
"_test",
|
|
202
|
+
"preloaded",
|
|
203
|
+
nonPreloadedUrl
|
|
204
|
+
]);
|
|
205
|
+
deepStrictEqual(cachedValue2, result3, "Non-preloaded URLs should be cached");
|
|
206
|
+
});
|
|
207
|
+
});
|
|
208
|
+
|
|
209
|
+
//#endregion
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
|
|
2
|
+
const { Temporal } = require("@js-temporal/polyfill");
|
|
3
|
+
const { URLPattern } = require("urlpattern-polyfill");
|
|
4
|
+
|
|
5
|
+
require('../lookup-CLaDFNx1.cjs');
|
|
6
|
+
require('../actor-_9UN5RVT.cjs');
|
|
7
|
+
require('../http-So5V_Tgv.cjs');
|
|
8
|
+
const require_kv_cache = require('../kv-cache-X2ggcnHI.cjs');
|
|
9
|
+
require('../utils-DyRU1gdZ.cjs');
|
|
10
|
+
|
|
11
|
+
exports.getAuthenticatedDocumentLoader = require_kv_cache.getAuthenticatedDocumentLoader;
|
|
12
|
+
exports.kvCache = require_kv_cache.kvCache;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Temporal } from "@js-temporal/polyfill";
|
|
2
|
+
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
+
import "../vocab-BCWe1Ih5.js";
|
|
4
|
+
import "../http-BbO0ejuk.js";
|
|
5
|
+
import "../kv-BKNZ-Tb-.js";
|
|
6
|
+
import { getAuthenticatedDocumentLoader, kvCache } from "../mod-aAE2wOWV.js";
|
|
7
|
+
export { getAuthenticatedDocumentLoader, kvCache };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
|
|
2
|
+
import { Temporal } from "@js-temporal/polyfill";
|
|
3
|
+
import { URLPattern } from "urlpattern-polyfill";
|
|
4
|
+
|
|
5
|
+
import "../lookup-CtC3x1M6.js";
|
|
6
|
+
import "../actor-C-FuEZU4.js";
|
|
7
|
+
import "../http-Q_l4fCEE.js";
|
|
8
|
+
import { getAuthenticatedDocumentLoader, kvCache } from "../kv-cache-R1oW382l.js";
|
|
9
|
+
import "../utils-D-Va7aXC.js";
|
|
10
|
+
|
|
11
|
+
export { getAuthenticatedDocumentLoader, kvCache };
|
package/dist/vocab/actor.test.js
CHANGED
|
@@ -3,19 +3,17 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import { Application, Group, Organization, Person, Service, __export } from "../
|
|
6
|
+
import { Application, Group, Organization, Person, Service, __export } from "../lookup-C7SSHgK7.js";
|
|
7
7
|
import { assertEquals } from "../assert_equals-DSbWqCm3.js";
|
|
8
8
|
import { assert } from "../assert-MZs1qjMx.js";
|
|
9
9
|
import "../assert_instance_of-DHz7EHNU.js";
|
|
10
|
-
import "../
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import "../
|
|
16
|
-
import "../
|
|
17
|
-
import { assertThrows } from "../assert_throws-BOO88avQ.js";
|
|
18
|
-
import { esm_default } from "../esm-aj4vkb76.js";
|
|
10
|
+
import { getActorClassByTypeName, getActorHandle, getActorTypeName, isActor, normalizeActorHandle } from "../actor-rOm0sXHU.js";
|
|
11
|
+
import { test } from "../testing-D-nLIHkh.js";
|
|
12
|
+
import { assertStrictEquals } from "../std__assert-DWivtrGR.js";
|
|
13
|
+
import { assertFalse, assertRejects } from "../assert_rejects-Ce45JcFg.js";
|
|
14
|
+
import { assertThrows } from "../assert_throws-BNXdRGWP.js";
|
|
15
|
+
import "../assert_not_equals-C80BG-_5.js";
|
|
16
|
+
import { esm_default } from "../esm-BEFbR5eN.js";
|
|
19
17
|
|
|
20
18
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/check/precondition/PreconditionFailure.js
|
|
21
19
|
var PreconditionFailure = class PreconditionFailure extends Error {
|
|
@@ -3,19 +3,17 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import { Collection, Note, Object as Object$1, Person } from "../
|
|
6
|
+
import { Collection, Note, Object as Object$1, Person, lookupObject, traverseCollection } from "../lookup-C7SSHgK7.js";
|
|
7
7
|
import { assertEquals } from "../assert_equals-DSbWqCm3.js";
|
|
8
8
|
import { assert } from "../assert-MZs1qjMx.js";
|
|
9
9
|
import { assertInstanceOf } from "../assert_instance_of-DHz7EHNU.js";
|
|
10
|
-
import {
|
|
11
|
-
import
|
|
12
|
-
import "../
|
|
13
|
-
import
|
|
14
|
-
import "../
|
|
15
|
-
import "../
|
|
16
|
-
import "../
|
|
17
|
-
import { createTestTracerProvider } from "../otel-Chy5T2Xh.js";
|
|
18
|
-
import { esm_default } from "../esm-aj4vkb76.js";
|
|
10
|
+
import { mockDocumentLoader, test } from "../testing-D-nLIHkh.js";
|
|
11
|
+
import "../std__assert-DWivtrGR.js";
|
|
12
|
+
import { assertRejects } from "../assert_rejects-Ce45JcFg.js";
|
|
13
|
+
import "../assert_throws-BNXdRGWP.js";
|
|
14
|
+
import "../assert_not_equals-C80BG-_5.js";
|
|
15
|
+
import { createTestTracerProvider } from "../otel-1BmGPuZc.js";
|
|
16
|
+
import { esm_default } from "../esm-BEFbR5eN.js";
|
|
19
17
|
|
|
20
18
|
//#region src/vocab/lookup.test.ts
|
|
21
19
|
test("lookupObject()", {
|
package/dist/vocab/mod.cjs
CHANGED
|
@@ -2,10 +2,9 @@
|
|
|
2
2
|
const { Temporal } = require("@js-temporal/polyfill");
|
|
3
3
|
const { URLPattern } = require("urlpattern-polyfill");
|
|
4
4
|
|
|
5
|
-
require('../
|
|
6
|
-
const require_actor = require('../actor-
|
|
7
|
-
require('../
|
|
8
|
-
const require_vocab = require('../vocab-BjnZ49Xt.cjs');
|
|
5
|
+
require('../lookup-CLaDFNx1.cjs');
|
|
6
|
+
const require_actor = require('../actor-_9UN5RVT.cjs');
|
|
7
|
+
const require_vocab = require('../vocab-C96aggZM.cjs');
|
|
9
8
|
|
|
10
9
|
exports.Accept = require_actor.Accept;
|
|
11
10
|
exports.Activity = require_actor.Activity;
|
package/dist/vocab/mod.d.cts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import "../
|
|
2
|
-
import "../
|
|
3
|
-
import {
|
|
4
|
-
import { Actor, ActorTypeName, GetActorHandleOptions, NormalizeActorHandleOptions, Recipient, getActorClassByTypeName, getActorHandle, getActorTypeName, isActor, normalizeActorHandle } from "../actor-Ydzhc8dj.cjs";
|
|
5
|
-
import { FediverseHandle, LookupObjectOptions, PUBLIC_COLLECTION, TraverseCollectionOptions, getTypeId, isFediverseHandle, lookupObject, parseFediverseHandle, toAcctUrl, traverseCollection } from "../mod-BUbqxBev.cjs";
|
|
1
|
+
import { Accept, Activity, Add, Announce, Application, Arrive, Article, Audio, Block, ChatMessage, Collection, CollectionPage, Create, CryptographicKey, DataIntegrityProof, Delete, DidService, Dislike, Document, Emoji, EmojiReact, Endpoints, Event, Export, Flag, Follow, Group, Hashtag, Ignore, Image, IntransitiveActivity, Invite, Join, Leave, Like, Link, Listen, Mention, Move, Multikey, Note, Object as Object$1, Offer, OrderedCollection, OrderedCollectionPage, Organization, Page, Person, Place, Profile, PropertyValue, Question, Read, Reject, Relationship, Remove, Service, Source, TentativeAccept, TentativeReject, Tombstone, Travel, Undo, Update, Video, View } from "../vocab-CeDBzu-f.cjs";
|
|
2
|
+
import { Actor, ActorTypeName, GetActorHandleOptions, NormalizeActorHandleOptions, Recipient, getActorClassByTypeName, getActorHandle, getActorTypeName, isActor, normalizeActorHandle } from "../actor-f2NtjyCg.cjs";
|
|
3
|
+
import { FediverseHandle, LookupObjectOptions, PUBLIC_COLLECTION, TraverseCollectionOptions, getTypeId, isFediverseHandle, lookupObject, parseFediverseHandle, toAcctUrl, traverseCollection } from "../mod-BxRCHTz-.cjs";
|
|
6
4
|
export { Accept, Activity, Actor, ActorTypeName, Add, Announce, Application, Arrive, Article, Audio, Block, ChatMessage, Collection, CollectionPage, Create, CryptographicKey, DataIntegrityProof, Delete, DidService, Dislike, Document, Emoji, EmojiReact, Endpoints, Event, Export, FediverseHandle, Flag, Follow, GetActorHandleOptions, Group, Hashtag, Ignore, Image, IntransitiveActivity, Invite, Join, Leave, Like, Link, Listen, LookupObjectOptions, Mention, Move, Multikey, NormalizeActorHandleOptions, Note, Object$1 as Object, Offer, OrderedCollection, OrderedCollectionPage, Organization, PUBLIC_COLLECTION, Page, Person, Place, Profile, PropertyValue, Question, Read, Recipient, Reject, Relationship, Remove, Service, Source, TentativeAccept, TentativeReject, Tombstone, Travel, TraverseCollectionOptions, Undo, Update, Video, View, getActorClassByTypeName, getActorHandle, getActorTypeName, getTypeId, isActor, isFediverseHandle, lookupObject, normalizeActorHandle, parseFediverseHandle, toAcctUrl, traverseCollection };
|
package/dist/vocab/mod.d.ts
CHANGED
|
@@ -1,8 +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, ActorTypeName, GetActorHandleOptions, NormalizeActorHandleOptions, Recipient, getActorClassByTypeName, getActorHandle, getActorTypeName, isActor, normalizeActorHandle } from "../actor-C1Euqngb.js";
|
|
7
|
-
import { FediverseHandle, LookupObjectOptions, PUBLIC_COLLECTION, TraverseCollectionOptions, getTypeId, isFediverseHandle, lookupObject, parseFediverseHandle, toAcctUrl, traverseCollection } from "../mod-CDObsV1d.js";
|
|
3
|
+
import { Accept, Activity, Add, Announce, Application, Arrive, Article, Audio, Block, ChatMessage, Collection, CollectionPage, Create, CryptographicKey, DataIntegrityProof, Delete, DidService, Dislike, Document, Emoji, EmojiReact, Endpoints, Event, Export, Flag, Follow, Group, Hashtag, Ignore, Image, IntransitiveActivity, Invite, Join, Leave, Like, Link, Listen, Mention, Move, Multikey, Note, Object as Object$1, Offer, OrderedCollection, OrderedCollectionPage, Organization, Page, Person, Place, Profile, PropertyValue, Question, Read, Reject, Relationship, Remove, Service, Source, TentativeAccept, TentativeReject, Tombstone, Travel, Undo, Update, Video, View } from "../vocab-BCWe1Ih5.js";
|
|
4
|
+
import { Actor, ActorTypeName, GetActorHandleOptions, NormalizeActorHandleOptions, Recipient, getActorClassByTypeName, getActorHandle, getActorTypeName, isActor, normalizeActorHandle } from "../actor-DqFajh9s.js";
|
|
5
|
+
import { FediverseHandle, LookupObjectOptions, PUBLIC_COLLECTION, TraverseCollectionOptions, getTypeId, isFediverseHandle, lookupObject, parseFediverseHandle, toAcctUrl, traverseCollection } from "../mod-BlVovdcy.js";
|
|
8
6
|
export { Accept, Activity, Actor, ActorTypeName, Add, Announce, Application, Arrive, Article, Audio, Block, ChatMessage, Collection, CollectionPage, Create, CryptographicKey, DataIntegrityProof, Delete, DidService, Dislike, Document, Emoji, EmojiReact, Endpoints, Event, Export, FediverseHandle, Flag, Follow, GetActorHandleOptions, Group, Hashtag, Ignore, Image, IntransitiveActivity, Invite, Join, Leave, Like, Link, Listen, LookupObjectOptions, Mention, Move, Multikey, NormalizeActorHandleOptions, Note, Object$1 as Object, Offer, OrderedCollection, OrderedCollectionPage, Organization, PUBLIC_COLLECTION, Page, Person, Place, Profile, PropertyValue, Question, Read, Recipient, Reject, Relationship, Remove, Service, Source, TentativeAccept, TentativeReject, Tombstone, Travel, TraverseCollectionOptions, Undo, Update, Video, View, getActorClassByTypeName, getActorHandle, getActorTypeName, getTypeId, isActor, isFediverseHandle, lookupObject, normalizeActorHandle, parseFediverseHandle, toAcctUrl, traverseCollection };
|
package/dist/vocab/mod.js
CHANGED
|
@@ -2,9 +2,8 @@
|
|
|
2
2
|
import { Temporal } from "@js-temporal/polyfill";
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
|
|
5
|
-
import "../
|
|
6
|
-
import { Accept, Activity, Add, Announce, Application, Arrive, Article, Audio, Block, ChatMessage, Collection, CollectionPage, Create, CryptographicKey, DataIntegrityProof, Delete, DidService, Dislike, Document, Emoji, EmojiReact, Endpoints, Event, Export, Flag, Follow, Group, Hashtag, Ignore, Image, IntransitiveActivity, Invite, Join, Leave, Like, Link, Listen, Mention, Move, Multikey, Note, Object as Object$1, Offer, OrderedCollection, OrderedCollectionPage, Organization, Page, Person, Place, Profile, PropertyValue, Question, Read, Reject, Relationship, Remove, Service, Source, TentativeAccept, TentativeReject, Tombstone, Travel, Undo, Update, Video, View, getActorClassByTypeName, getActorHandle, getActorTypeName, getTypeId, isActor, normalizeActorHandle } from "../actor-
|
|
7
|
-
import "../
|
|
8
|
-
import { PUBLIC_COLLECTION, isFediverseHandle, lookupObject, parseFediverseHandle, toAcctUrl, traverseCollection } from "../vocab-CthegyUc.js";
|
|
5
|
+
import "../lookup-CtC3x1M6.js";
|
|
6
|
+
import { Accept, Activity, Add, Announce, Application, Arrive, Article, Audio, Block, ChatMessage, Collection, CollectionPage, Create, CryptographicKey, DataIntegrityProof, Delete, DidService, Dislike, Document, Emoji, EmojiReact, Endpoints, Event, Export, Flag, Follow, Group, Hashtag, Ignore, Image, IntransitiveActivity, Invite, Join, Leave, Like, Link, Listen, Mention, Move, Multikey, Note, Object as Object$1, Offer, OrderedCollection, OrderedCollectionPage, Organization, Page, Person, Place, Profile, PropertyValue, Question, Read, Reject, Relationship, Remove, Service, Source, TentativeAccept, TentativeReject, Tombstone, Travel, Undo, Update, Video, View, getActorClassByTypeName, getActorHandle, getActorTypeName, getTypeId, isActor, normalizeActorHandle } from "../actor-C-FuEZU4.js";
|
|
7
|
+
import { PUBLIC_COLLECTION, isFediverseHandle, lookupObject, parseFediverseHandle, toAcctUrl, traverseCollection } from "../vocab-axlR_8k0.js";
|
|
9
8
|
|
|
10
9
|
export { Accept, Activity, Add, Announce, Application, Arrive, Article, Audio, Block, ChatMessage, Collection, CollectionPage, Create, CryptographicKey, DataIntegrityProof, Delete, DidService, Dislike, Document, Emoji, EmojiReact, Endpoints, Event, Export, Flag, Follow, Group, Hashtag, Ignore, Image, IntransitiveActivity, Invite, Join, Leave, Like, Link, Listen, Mention, Move, Multikey, Note, Object$1 as Object, Offer, OrderedCollection, OrderedCollectionPage, Organization, PUBLIC_COLLECTION, Page, Person, Place, Profile, PropertyValue, Question, Read, Reject, Relationship, Remove, Service, Source, TentativeAccept, TentativeReject, Tombstone, Travel, Undo, Update, Video, View, getActorClassByTypeName, getActorHandle, getActorTypeName, getTypeId, isActor, isFediverseHandle, lookupObject, normalizeActorHandle, parseFediverseHandle, toAcctUrl, traverseCollection };
|