@fedify/fedify 1.7.12 → 1.7.14
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-CPpvuBKU.d.ts → actor-Dx5YX74F.d.ts} +3 -3
- package/dist/{actor-GZRoTRqg.js → actor-OYVgkiZG.js} +329 -465
- package/dist/{actor-TYqJGdVq.js → actor-y7shp0CR.js} +6 -6
- package/dist/{assert-LOEeCUK5.js → assert-C-mZuSQl.js} +2 -2
- package/dist/{assert_equals-B44MxcIj.js → assert_equals-Dy0MG_Zw.js} +16 -16
- package/dist/{assert_instance_of-XtuFevV_.js → assert_instance_of-lS0Jr2iu.js} +2 -2
- package/dist/{assert_is_error-BTlryvT0.js → assert_is_error-CIYFACrT.js} +2 -2
- package/dist/{assert_not_equals-C685gKx6.js → assert_not_equals-C1azCAB0.js} +3 -6
- package/dist/{assert_rejects-DWQ4jaf9.js → assert_rejects-Bkh5lA1a.js} +3 -3
- package/dist/{assert_throws-YetpVSc-.js → assert_throws-CmpfkWEM.js} +3 -3
- package/dist/{authdocloader-hiFSyM7V.js → authdocloader-C0JcfxUs.js} +7 -9
- package/dist/{authdocloader-BopfyipD.js → authdocloader-C2krvRo1.js} +6 -8
- package/dist/{builder-mi6RdzNE.js → builder-DaECqbbT.js} +7 -7
- package/dist/{chunk-Cx8LTkjm.js → chunk-DvTpRkcT.js} +22 -15
- package/dist/{client-DuUKk4pk.js → client-dfu57WLy.js} +3 -3
- package/dist/{client-DvtwXO7t.d.ts → client-wKLuY12i.d.ts} +2 -2
- package/dist/{collection-Dfb0TPno.js → collection-XNLQhehO.js} +2 -3
- package/dist/{mod-DFncUgcE.d.ts → compat/mod-Bwqav33K.d.ts} +3 -3
- package/dist/compat/mod.js +1 -2
- package/dist/compat/transformers.test.js +34 -38
- package/dist/{context-OBWjptjU.d.ts → context-CW_8R4BH.d.ts} +11 -11
- package/dist/{context-RMU32mk4.js → context-nxDPfAiA.js} +5 -5
- package/dist/{docloader-09nVWLAZ.js → docloader-BDSHZfTJ.js} +1 -1
- package/dist/{docloader-DJxET2fN.js → docloader-BU25UQLB.js} +31 -151
- package/dist/{docloader-Q42SMRIB.d.ts → docloader-D_MGP37Q.d.ts} +2 -2
- package/dist/{docloader-bgBm1Hd1.js → docloader-sGz4vcrK.js} +32 -152
- package/dist/{esm-DO9PrujO.js → esm-BRXvTSrx.js} +36 -22
- package/dist/federation/builder.test.js +20 -26
- package/dist/federation/collection.test.js +11 -16
- package/dist/federation/handler.test.js +41 -48
- package/dist/federation/inbox.test.js +11 -11
- package/dist/federation/keycache.test.js +12 -11
- package/dist/federation/kv.test.js +8 -10
- package/dist/federation/middleware.test.js +105 -134
- package/dist/federation/mod-DvlLc8Ru.d.ts +6 -0
- package/dist/federation/mod.js +206 -12
- package/dist/federation/mq.test.js +12 -17
- package/dist/federation/retry.test.js +5 -4
- package/dist/federation/router.test.js +9 -10
- package/dist/federation/send.test.js +23 -24
- package/dist/{http-D2DkwsjA.js → http-BhES0Sg9.js} +23 -30
- package/dist/{http-DMTrO3Ye.d.ts → http-DFZRNfDP.d.ts} +3 -3
- package/dist/{http-vqMAvOVs.js → http-DRePVWfE.js} +23 -30
- package/dist/{inbox-DAAZZl2k.js → inbox-Z_QlSGYN.js} +5 -5
- package/dist/key-CJuc1GE1.js +10 -0
- package/dist/{key-DmqJj57e.js → key-D2HZrCxh.js} +4 -4
- package/dist/{key-KVhaUM92.js → key-bMrDyA2T.js} +5 -5
- package/dist/key-eP5Yk7hl.js +16 -0
- package/dist/{keycache-C1pEuRyQ.js → keycache-B5Rr8Lbc.js} +2 -2
- package/dist/{keys-C4XQHW5_.js → keys-DK4k1R8e.js} +2 -2
- package/dist/{kv-DRaeSXco.d.ts → kv-CKqSUxHd.d.ts} +1 -1
- package/dist/{kv-BMY6Qf_A.js → kv-QeuZ51go.js} +1 -1
- package/dist/{langstr-DbWheeIS.js → langstr-pFHBDU4y.js} +1 -1
- package/dist/{ld-DzlJ_IpT.js → ld--auFISy7.js} +9 -12
- package/dist/{lookup-CSngxuWm.js → lookup-4uc2jh52.js} +3 -3
- package/dist/{lookup-DL62q3Xh.js → lookup-Bq8vhIG4.js} +4 -4
- package/dist/{lookup-Bf-K85bV.d.ts → lookup-CqI9jhXo.d.ts} +2 -2
- package/dist/{lookup-D0je8AqR.js → lookup-cHV4n1IB.js} +6 -6
- package/dist/middleware-72Tuh6Iw.js +17 -0
- package/dist/{middleware-3wVT6S9E.js → middleware-B7p-onxQ.js} +35 -39
- package/dist/middleware-DB3BUysJ.js +32 -0
- package/dist/{middleware-DlDXugwZ.js → middleware-QJjRfjjc.js} +38 -43
- package/dist/{mod-CCL2cvnI.d.ts → mod-BEZy4WHZ.d.ts} +4 -4
- package/dist/mod-DMn4Bxyg.d.ts +20 -0
- package/dist/{mod-CDzlVCUF.d.ts → mod-DjGYGrBd.d.ts} +3 -3
- package/dist/mod.js +17 -17
- package/dist/{mq-DYKDDJmp.d.ts → mq-Cgfbl44M.d.ts} +1 -1
- package/dist/{multibase-CnLHszip.js → multibase-DBcKTV2a.js} +1 -1
- package/dist/nodeinfo/client.test.js +19 -28
- package/dist/nodeinfo/handler.test.js +37 -44
- package/dist/nodeinfo/mod--upgPcaX.d.ts +4 -0
- package/dist/nodeinfo/mod.js +2 -3
- package/dist/nodeinfo/semver.test.js +13 -21
- package/dist/nodeinfo/types.test.js +9 -11
- package/dist/{owner-D0cOz8R5.d.ts → owner-CewLNqWO.d.ts} +4 -4
- package/dist/{owner-81ey_76X.js → owner-DkTRLQAV.js} +4 -4
- package/dist/{proof-DlI7QNdn.js → proof-D4HXHDPz.js} +14 -19
- package/dist/{proof-BlULDH4H.js → proof-DT_xxRPF.js} +11 -13
- package/dist/{retry-BiIhZWgD.js → retry-BQet39_l.js} +1 -1
- package/dist/{router-D_aVZZUc.js → router-BuDkN4RQ.js} +1 -1
- package/dist/runtime/authdocloader.test.js +22 -26
- package/dist/runtime/docloader.test.js +56 -56
- package/dist/runtime/key.test.js +31 -53
- package/dist/runtime/langstr.test.js +8 -10
- package/dist/{mod-qFMzZ3iF.d.ts → runtime/mod-BaH1vtHp.d.ts} +4 -3
- package/dist/runtime/mod.js +6 -7
- package/dist/runtime/multibase/multibase.test.js +12 -18
- package/dist/runtime/url.test.js +7 -6
- package/dist/{semver-BNrOOAs9.js → semver-D9d-VO-_.js} +7 -17
- package/dist/{send-DdxfTHo6.js → send-axIyQX2p.js} +4 -4
- package/dist/sig/http.test.js +104 -168
- package/dist/sig/key.test.js +17 -20
- package/dist/sig/ld.test.js +28 -35
- package/dist/sig/mod-BmJQTnPT.d.ts +6 -0
- package/dist/sig/mod.js +6 -7
- package/dist/sig/owner.test.js +24 -30
- package/dist/sig/proof.test.js +24 -29
- package/dist/{std__assert-o_r9vqm1.js → std__assert-BdP_WkD-.js} +7 -13
- package/dist/testing/docloader.test.js +9 -12
- package/dist/testing/mod.js +2 -1
- package/dist/{testing-DLyvtiiW.js → testing-qaAD4B0t.js} +2 -2
- package/dist/{transformers-ghwJuzGY.js → transformers-CFSWUhNi.js} +1 -1
- package/dist/{type-CFuiGLz9.js → type-DFsmi-p1.js} +1 -1
- package/dist/{types-CmVV9LT1.js → types-Bk4b1bGc.js} +8 -18
- package/dist/{types-CJHS5pXl.js → types-CB_2uuCA.js} +2 -2
- package/dist/{url-C2xuoQD1.js → url-BdNvnK9P.js} +1 -1
- package/dist/vocab/actor.test.js +76 -128
- package/dist/vocab/lookup.test.js +19 -23
- package/dist/vocab/mod-BkXGAYkx.d.ts +6 -0
- package/dist/vocab/mod.js +4 -4
- package/dist/vocab/type.test.js +10 -10
- package/dist/vocab/vocab.test.js +109 -105
- package/dist/{vocab-DFlq4Wa6.js → vocab-DCHRuBGF.js} +328 -464
- package/dist/{vocab-CzEfWQk2.d.ts → vocab-DoBcp8ow.d.ts} +2 -2
- package/dist/{vocab-BebR0kAy.js → vocab-sMuiKIWm.js} +5 -5
- package/dist/webfinger/handler.test.js +40 -48
- package/dist/webfinger/lookup.test.js +12 -15
- package/dist/webfinger/mod-B1UhCvlL.d.ts +4 -0
- package/dist/webfinger/mod.js +2 -3
- package/dist/x/{cfworkers.d.ts → cfworkers-BIcR64Sf.d.ts} +2 -2
- package/dist/x/cfworkers.test.js +7 -9
- package/dist/x/{hono.d.ts → hono-DmQmp8wi.d.ts} +2 -11
- package/dist/x/{sveltekit.d.ts → sveltekit-Cvh0XnN4.d.ts} +2 -11
- package/package.json +1 -1
- package/dist/compat/mod.d.ts +0 -15
- package/dist/compat-Bb5myD13.js +0 -4
- package/dist/federation/mod.d.ts +0 -15
- package/dist/federation-B0aljx0V.js +0 -203
- package/dist/key-5ssHQ67E.js +0 -16
- package/dist/key-DSJGnD10.js +0 -10
- package/dist/middleware-CxFoFBD8.js +0 -33
- package/dist/middleware-w7_U3fFi.js +0 -17
- package/dist/mod-1pDWKvUL.d.ts +0 -2
- package/dist/mod-GIh5OYxW.d.ts +0 -2
- package/dist/mod-g0xFzAP9.d.ts +0 -2
- package/dist/mod.d.ts +0 -20
- package/dist/nodeinfo/mod.d.ts +0 -7
- package/dist/nodeinfo-CyEbLjHs.js +0 -4
- package/dist/runtime/mod.d.ts +0 -8
- package/dist/runtime-BSkOVUWM.js +0 -4
- package/dist/sig/mod.d.ts +0 -10
- package/dist/sig-BXJO--F9.js +0 -4
- package/dist/vocab/mod.d.ts +0 -8
- package/dist/webfinger/mod.d.ts +0 -7
- package/dist/webfinger-C3GIyXIg.js +0 -4
- /package/dist/compat/{transformers.test.d.ts → transformers.test-DnJbd34u.d.ts} +0 -0
- /package/dist/{denokv-CvROlGYX.js → denokv-NcJeZ6rP.js} +0 -0
- /package/dist/federation/{builder.test.d.ts → builder.test-Bpt6NOZ6.d.ts} +0 -0
- /package/dist/federation/{collection.test.d.ts → collection.test-DKJ6JOZz.d.ts} +0 -0
- /package/dist/federation/{handler.test.d.ts → handler.test-BMT7uLC0.d.ts} +0 -0
- /package/dist/federation/{inbox.test.d.ts → inbox.test-Do6i02Qp.d.ts} +0 -0
- /package/dist/federation/{keycache.test.d.ts → keycache.test-BT83IPZY.d.ts} +0 -0
- /package/dist/federation/{kv.test.d.ts → kv.test-kFzzF2VN.d.ts} +0 -0
- /package/dist/federation/{middleware.test.d.ts → middleware.test-B1R4_e3-.d.ts} +0 -0
- /package/dist/federation/{mq.test.d.ts → mq.test-l79EQQOe.d.ts} +0 -0
- /package/dist/federation/{retry.test.d.ts → retry.test-BqS50VCX.d.ts} +0 -0
- /package/dist/federation/{router.test.d.ts → router.test-CYQl4po-.d.ts} +0 -0
- /package/dist/federation/{send.test.d.ts → send.test-COUnNUzv.d.ts} +0 -0
- /package/dist/nodeinfo/{client.test.d.ts → client.test-CZLe79hL.d.ts} +0 -0
- /package/dist/nodeinfo/{handler.test.d.ts → handler.test-B-EDZ_hK.d.ts} +0 -0
- /package/dist/nodeinfo/{semver.test.d.ts → semver.test-BEuuQSEM.d.ts} +0 -0
- /package/dist/nodeinfo/{types.test.d.ts → types.test-B5AT89WV.d.ts} +0 -0
- /package/dist/runtime/{authdocloader.test.d.ts → authdocloader.test-hCRKzn9v.d.ts} +0 -0
- /package/dist/runtime/{docloader.test.d.ts → docloader.test-CVd7i_5h.d.ts} +0 -0
- /package/dist/runtime/{key.test.d.ts → key.test-DBsILYSD.d.ts} +0 -0
- /package/dist/runtime/{langstr.test.d.ts → langstr.test-CiKxuuRY.d.ts} +0 -0
- /package/dist/runtime/multibase/{multibase.test.d.ts → multibase.test-Brh6gPBP.d.ts} +0 -0
- /package/dist/runtime/{url.test.d.ts → url.test-DlRqkU2j.d.ts} +0 -0
- /package/dist/sig/{http.test.d.ts → http.test-BpXNAWNI.d.ts} +0 -0
- /package/dist/sig/{key.test.d.ts → key.test-B2iLIugy.d.ts} +0 -0
- /package/dist/sig/{ld.test.d.ts → ld.test-D-cI70Gw.d.ts} +0 -0
- /package/dist/sig/{owner.test.d.ts → owner.test-B_YRjMPj.d.ts} +0 -0
- /package/dist/sig/{proof.test.d.ts → proof.test-BagEM_-4.d.ts} +0 -0
- /package/dist/testing/{docloader.test.d.ts → docloader.test-lrzf6sDZ.d.ts} +0 -0
- /package/dist/testing/{mod.d.ts → mod-3uM8ZvS7.d.ts} +0 -0
- /package/dist/vocab/{actor.test.d.ts → actor.test-ClC-iVWk.d.ts} +0 -0
- /package/dist/vocab/{lookup.test.d.ts → lookup.test-Cq1I-27w.d.ts} +0 -0
- /package/dist/vocab/{type.test.d.ts → type.test-bfFiYGcs.d.ts} +0 -0
- /package/dist/vocab/{vocab.test.d.ts → vocab.test-h-ZTisfu.d.ts} +0 -0
- /package/dist/webfinger/{handler.test.d.ts → handler.test-DiUeEDDD.d.ts} +0 -0
- /package/dist/webfinger/{lookup.test.d.ts → lookup.test-D9onm3U3.d.ts} +0 -0
- /package/dist/x/{cfworkers.test.d.ts → cfworkers.test-KXHlJ29z.d.ts} +0 -0
package/dist/vocab/vocab.test.js
CHANGED
|
@@ -3,35 +3,36 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import "../
|
|
10
|
-
import "../
|
|
11
|
-
import
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import "../
|
|
16
|
-
import
|
|
17
|
-
import "../
|
|
18
|
-
import
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
6
|
+
import "../chunk-DvTpRkcT.js";
|
|
7
|
+
import { n as isWindows, t as assertEquals } from "../assert_equals-Dy0MG_Zw.js";
|
|
8
|
+
import { t as assert } from "../assert-C-mZuSQl.js";
|
|
9
|
+
import { t as assertInstanceOf } from "../assert_instance_of-lS0Jr2iu.js";
|
|
10
|
+
import "../docloader-sGz4vcrK.js";
|
|
11
|
+
import "../url-BdNvnK9P.js";
|
|
12
|
+
import { t as decode } from "../multibase-DBcKTV2a.js";
|
|
13
|
+
import { C as Place, E as Source, O as vocab_exports, S as Person, _ as Object$1, a as Create, b as OrderedCollectionPage, d as Hashtag, g as Note, l as Follow, m as Link, n as Announce, o as CryptographicKey, t as Activity, w as Question } from "../vocab-DCHRuBGF.js";
|
|
14
|
+
import { t as LanguageString } from "../langstr-pFHBDU4y.js";
|
|
15
|
+
import { t as test } from "../testing-qaAD4B0t.js";
|
|
16
|
+
import "../std__assert-BdP_WkD-.js";
|
|
17
|
+
import { n as assertFalse, t as assertRejects } from "../assert_rejects-Bkh5lA1a.js";
|
|
18
|
+
import "../assert_is_error-CIYFACrT.js";
|
|
19
|
+
import { t as assertNotEquals } from "../assert_not_equals-C1azCAB0.js";
|
|
20
|
+
import { t as assertThrows } from "../assert_throws-CmpfkWEM.js";
|
|
21
|
+
import { t as mockDocumentLoader } from "../docloader-BDSHZfTJ.js";
|
|
22
|
+
import { o as rsaPublicKey1, r as ed25519PublicKey } from "../keys-DK4k1R8e.js";
|
|
22
23
|
import { pascalCase } from "@es-toolkit/es-toolkit";
|
|
23
24
|
import { parseLanguageTag } from "@phensley/language-tag";
|
|
24
25
|
import { Validator } from "@cfworker/json-schema";
|
|
25
26
|
import { readFile, readdir } from "node:fs/promises";
|
|
26
27
|
import { join } from "node:path";
|
|
27
28
|
|
|
28
|
-
//#region node_modules/.pnpm/@jsr+std__path@1.1.
|
|
29
|
+
//#region node_modules/.pnpm/@jsr+std__path@1.1.3/node_modules/@jsr/std__path/_common/assert_path.js
|
|
29
30
|
function assertPath(path) {
|
|
30
31
|
if (typeof path !== "string") throw new TypeError(`Path must be a string, received "${JSON.stringify(path)}"`);
|
|
31
32
|
}
|
|
32
33
|
|
|
33
34
|
//#endregion
|
|
34
|
-
//#region node_modules/.pnpm/@jsr+std__path@1.1.
|
|
35
|
+
//#region node_modules/.pnpm/@jsr+std__path@1.1.3/node_modules/@jsr/std__path/_common/from_file_url.js
|
|
35
36
|
function assertArg$2(url) {
|
|
36
37
|
url = url instanceof URL ? url : new URL(url);
|
|
37
38
|
if (url.protocol !== "file:") throw new TypeError(`URL must be a file URL: received "${url.protocol}"`);
|
|
@@ -39,7 +40,7 @@ function assertArg$2(url) {
|
|
|
39
40
|
}
|
|
40
41
|
|
|
41
42
|
//#endregion
|
|
42
|
-
//#region node_modules/.pnpm/@jsr+std__path@1.1.
|
|
43
|
+
//#region node_modules/.pnpm/@jsr+std__path@1.1.3/node_modules/@jsr/std__path/posix/from_file_url.js
|
|
43
44
|
/**
|
|
44
45
|
* Converts a file URL to a path string.
|
|
45
46
|
*
|
|
@@ -53,13 +54,13 @@ function assertArg$2(url) {
|
|
|
53
54
|
*
|
|
54
55
|
* @param url The file URL to convert.
|
|
55
56
|
* @returns The path string.
|
|
56
|
-
*/ function fromFileUrl$
|
|
57
|
+
*/ function fromFileUrl$2(url) {
|
|
57
58
|
url = assertArg$2(url);
|
|
58
59
|
return decodeURIComponent(url.pathname.replace(/%(?![0-9A-Fa-f]{2})/g, "%25"));
|
|
59
60
|
}
|
|
60
61
|
|
|
61
62
|
//#endregion
|
|
62
|
-
//#region node_modules/.pnpm/@jsr+std__path@1.1.
|
|
63
|
+
//#region node_modules/.pnpm/@jsr+std__path@1.1.3/node_modules/@jsr/std__path/_common/strip_trailing_separators.js
|
|
63
64
|
function stripTrailingSeparators(segment, isSep) {
|
|
64
65
|
if (segment.length <= 1) return segment;
|
|
65
66
|
let end = segment.length;
|
|
@@ -69,18 +70,18 @@ function stripTrailingSeparators(segment, isSep) {
|
|
|
69
70
|
}
|
|
70
71
|
|
|
71
72
|
//#endregion
|
|
72
|
-
//#region node_modules/.pnpm/@jsr+std__path@1.1.
|
|
73
|
+
//#region node_modules/.pnpm/@jsr+std__path@1.1.3/node_modules/@jsr/std__path/_common/constants.js
|
|
73
74
|
const CHAR_DOT = 46;
|
|
74
75
|
const CHAR_FORWARD_SLASH = 47;
|
|
75
76
|
|
|
76
77
|
//#endregion
|
|
77
|
-
//#region node_modules/.pnpm/@jsr+std__path@1.1.
|
|
78
|
+
//#region node_modules/.pnpm/@jsr+std__path@1.1.3/node_modules/@jsr/std__path/posix/_util.js
|
|
78
79
|
function isPosixPathSeparator(code) {
|
|
79
80
|
return code === CHAR_FORWARD_SLASH;
|
|
80
81
|
}
|
|
81
82
|
|
|
82
83
|
//#endregion
|
|
83
|
-
//#region node_modules/.pnpm/@jsr+std__path@1.1.
|
|
84
|
+
//#region node_modules/.pnpm/@jsr+std__path@1.1.3/node_modules/@jsr/std__path/windows/from_file_url.js
|
|
84
85
|
/**
|
|
85
86
|
* Converts a file URL to a path string.
|
|
86
87
|
*
|
|
@@ -96,7 +97,7 @@ function isPosixPathSeparator(code) {
|
|
|
96
97
|
*
|
|
97
98
|
* @param url The file URL to convert.
|
|
98
99
|
* @returns The path string.
|
|
99
|
-
*/ function fromFileUrl$
|
|
100
|
+
*/ function fromFileUrl$1(url) {
|
|
100
101
|
url = assertArg$2(url);
|
|
101
102
|
let path = decodeURIComponent(url.pathname.replace(/\//g, "\\").replace(/%(?![0-9A-Fa-f]{2})/g, "%25")).replace(/^\\*([A-Za-z]:)(\\|$)/, "$1\\");
|
|
102
103
|
if (url.hostname !== "") path = `\\\\${url.hostname}${path}`;
|
|
@@ -104,14 +105,14 @@ function isPosixPathSeparator(code) {
|
|
|
104
105
|
}
|
|
105
106
|
|
|
106
107
|
//#endregion
|
|
107
|
-
//#region node_modules/.pnpm/@jsr+std__path@1.1.
|
|
108
|
+
//#region node_modules/.pnpm/@jsr+std__path@1.1.3/node_modules/@jsr/std__path/_common/dirname.js
|
|
108
109
|
function assertArg$1(path) {
|
|
109
110
|
assertPath(path);
|
|
110
111
|
if (path.length === 0) return ".";
|
|
111
112
|
}
|
|
112
113
|
|
|
113
114
|
//#endregion
|
|
114
|
-
//#region node_modules/.pnpm/@jsr+std__path@1.1.
|
|
115
|
+
//#region node_modules/.pnpm/@jsr+std__path@1.1.3/node_modules/@jsr/std__path/posix/dirname.js
|
|
115
116
|
/**
|
|
116
117
|
* Return the directory path of a `path`.
|
|
117
118
|
*
|
|
@@ -139,8 +140,8 @@ function assertArg$1(path) {
|
|
|
139
140
|
*
|
|
140
141
|
* @param path The path to get the directory from.
|
|
141
142
|
* @returns The directory path.
|
|
142
|
-
*/ function dirname(path) {
|
|
143
|
-
if (path instanceof URL) path = fromFileUrl$
|
|
143
|
+
*/ function dirname$1(path) {
|
|
144
|
+
if (path instanceof URL) path = fromFileUrl$2(path);
|
|
144
145
|
assertArg$1(path);
|
|
145
146
|
let end = -1;
|
|
146
147
|
let matchedNonSeparator = false;
|
|
@@ -155,7 +156,7 @@ function assertArg$1(path) {
|
|
|
155
156
|
}
|
|
156
157
|
|
|
157
158
|
//#endregion
|
|
158
|
-
//#region node_modules/.pnpm/@jsr+std__path@1.1.
|
|
159
|
+
//#region node_modules/.pnpm/@jsr+std__path@1.1.3/node_modules/@jsr/std__path/from_file_url.js
|
|
159
160
|
/**
|
|
160
161
|
* Converts a file URL to a path string.
|
|
161
162
|
*
|
|
@@ -176,18 +177,18 @@ function assertArg$1(path) {
|
|
|
176
177
|
* @param url The file URL to convert to a path.
|
|
177
178
|
* @returns The path string.
|
|
178
179
|
*/ function fromFileUrl(url) {
|
|
179
|
-
return isWindows ? fromFileUrl$
|
|
180
|
+
return isWindows ? fromFileUrl$1(url) : fromFileUrl$2(url);
|
|
180
181
|
}
|
|
181
182
|
|
|
182
183
|
//#endregion
|
|
183
|
-
//#region node_modules/.pnpm/@jsr+std__path@1.1.
|
|
184
|
+
//#region node_modules/.pnpm/@jsr+std__path@1.1.3/node_modules/@jsr/std__path/_common/normalize.js
|
|
184
185
|
function assertArg(path) {
|
|
185
186
|
assertPath(path);
|
|
186
187
|
if (path.length === 0) return ".";
|
|
187
188
|
}
|
|
188
189
|
|
|
189
190
|
//#endregion
|
|
190
|
-
//#region node_modules/.pnpm/@jsr+std__path@1.1.
|
|
191
|
+
//#region node_modules/.pnpm/@jsr+std__path@1.1.3/node_modules/@jsr/std__path/_common/normalize_string.js
|
|
191
192
|
function normalizeString(path, allowAboveRoot, separator, isPathSeparator) {
|
|
192
193
|
let res = "";
|
|
193
194
|
let lastSegmentLength = 0;
|
|
@@ -240,7 +241,7 @@ function normalizeString(path, allowAboveRoot, separator, isPathSeparator) {
|
|
|
240
241
|
}
|
|
241
242
|
|
|
242
243
|
//#endregion
|
|
243
|
-
//#region node_modules/.pnpm/@jsr+std__path@1.1.
|
|
244
|
+
//#region node_modules/.pnpm/@jsr+std__path@1.1.3/node_modules/@jsr/std__path/posix/normalize.js
|
|
244
245
|
/**
|
|
245
246
|
* Normalize the `path`, resolving `'..'` and `'.'` segments.
|
|
246
247
|
* Note that resolving these segments does not necessarily mean that all will be eliminated.
|
|
@@ -276,7 +277,7 @@ function normalizeString(path, allowAboveRoot, separator, isPathSeparator) {
|
|
|
276
277
|
* @param path The path to normalize.
|
|
277
278
|
* @returns The normalized path.
|
|
278
279
|
*/ function normalize(path) {
|
|
279
|
-
if (path instanceof URL) path = fromFileUrl$
|
|
280
|
+
if (path instanceof URL) path = fromFileUrl$2(path);
|
|
280
281
|
assertArg(path);
|
|
281
282
|
const isAbsolute = isPosixPathSeparator(path.charCodeAt(0));
|
|
282
283
|
const trailingSeparator = isPosixPathSeparator(path.charCodeAt(path.length - 1));
|
|
@@ -288,7 +289,7 @@ function normalizeString(path, allowAboveRoot, separator, isPathSeparator) {
|
|
|
288
289
|
}
|
|
289
290
|
|
|
290
291
|
//#endregion
|
|
291
|
-
//#region node_modules/.pnpm/@jsr+std__path@1.1.
|
|
292
|
+
//#region node_modules/.pnpm/@jsr+std__path@1.1.3/node_modules/@jsr/std__path/posix/join.js
|
|
292
293
|
/**
|
|
293
294
|
* Join all given a sequence of `paths`,then normalizes the resulting path.
|
|
294
295
|
*
|
|
@@ -317,9 +318,9 @@ function normalizeString(path, allowAboveRoot, separator, isPathSeparator) {
|
|
|
317
318
|
* @param path The path to join. This can be string or file URL.
|
|
318
319
|
* @param paths The paths to join.
|
|
319
320
|
* @returns The joined path.
|
|
320
|
-
*/ function join$
|
|
321
|
+
*/ function join$2(path, ...paths) {
|
|
321
322
|
if (path === void 0) return ".";
|
|
322
|
-
if (path instanceof URL) path = fromFileUrl$
|
|
323
|
+
if (path instanceof URL) path = fromFileUrl$2(path);
|
|
323
324
|
paths = path ? [path, ...paths] : paths;
|
|
324
325
|
paths.forEach((path$1) => assertPath(path$1));
|
|
325
326
|
const joined = paths.filter((path$1) => path$1.length > 0).join("/");
|
|
@@ -361,10 +362,10 @@ function normalizeString(path, allowAboveRoot, separator, isPathSeparator) {
|
|
|
361
362
|
* @deprecated Use
|
|
362
363
|
* {@linkcode https://jsr.io/@std/path/doc/posix/~/dirname | @std/path/posix/dirname}
|
|
363
364
|
* instead (examples included). `@std/url` will be removed in the future.
|
|
364
|
-
*/ function dirname
|
|
365
|
+
*/ function dirname(url) {
|
|
365
366
|
url = new URL(url);
|
|
366
367
|
strip(url);
|
|
367
|
-
url.pathname = dirname(url.pathname);
|
|
368
|
+
url.pathname = dirname$1(url.pathname);
|
|
368
369
|
return url;
|
|
369
370
|
}
|
|
370
371
|
|
|
@@ -391,14 +392,14 @@ function normalizeString(path, allowAboveRoot, separator, isPathSeparator) {
|
|
|
391
392
|
* @deprecated Use
|
|
392
393
|
* {@linkcode https://jsr.io/@std/path/doc/posix/~/join | @std/path/posix/join}
|
|
393
394
|
* instead (examples included). `@std/url` will be removed in the future.
|
|
394
|
-
*/ function join$
|
|
395
|
+
*/ function join$1(url, ...paths) {
|
|
395
396
|
url = new URL(url);
|
|
396
|
-
url.pathname = join$
|
|
397
|
+
url.pathname = join$2(url.pathname, ...paths);
|
|
397
398
|
return url;
|
|
398
399
|
}
|
|
399
400
|
|
|
400
401
|
//#endregion
|
|
401
|
-
//#region node_modules/.pnpm/@jsr+std__yaml@1.0.
|
|
402
|
+
//#region node_modules/.pnpm/@jsr+std__yaml@1.0.10/node_modules/@jsr/std__yaml/_chars.js
|
|
402
403
|
const TAB = 9;
|
|
403
404
|
const LINE_FEED = 10;
|
|
404
405
|
const CARRIAGE_RETURN = 13;
|
|
@@ -440,7 +441,7 @@ function isFlowIndicator(c) {
|
|
|
440
441
|
}
|
|
441
442
|
|
|
442
443
|
//#endregion
|
|
443
|
-
//#region node_modules/.pnpm/@jsr+std__yaml@1.0.
|
|
444
|
+
//#region node_modules/.pnpm/@jsr+std__yaml@1.0.10/node_modules/@jsr/std__yaml/_type/binary.js
|
|
444
445
|
const BASE64_MAP = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";
|
|
445
446
|
function resolveYamlBinary(data) {
|
|
446
447
|
if (data === null) return false;
|
|
@@ -527,7 +528,7 @@ const binary = {
|
|
|
527
528
|
};
|
|
528
529
|
|
|
529
530
|
//#endregion
|
|
530
|
-
//#region node_modules/.pnpm/@jsr+std__yaml@1.0.
|
|
531
|
+
//#region node_modules/.pnpm/@jsr+std__yaml@1.0.10/node_modules/@jsr/std__yaml/_type/bool.js
|
|
531
532
|
const YAML_TRUE_BOOLEANS = [
|
|
532
533
|
"true",
|
|
533
534
|
"True",
|
|
@@ -560,7 +561,7 @@ const bool = {
|
|
|
560
561
|
};
|
|
561
562
|
|
|
562
563
|
//#endregion
|
|
563
|
-
//#region node_modules/.pnpm/@jsr+std__yaml@1.0.
|
|
564
|
+
//#region node_modules/.pnpm/@jsr+std__yaml@1.0.10/node_modules/@jsr/std__yaml/_utils.js
|
|
564
565
|
function isObject(value) {
|
|
565
566
|
return value !== null && typeof value === "object";
|
|
566
567
|
}
|
|
@@ -572,7 +573,7 @@ function isPlainObject(object) {
|
|
|
572
573
|
}
|
|
573
574
|
|
|
574
575
|
//#endregion
|
|
575
|
-
//#region node_modules/.pnpm/@jsr+std__yaml@1.0.
|
|
576
|
+
//#region node_modules/.pnpm/@jsr+std__yaml@1.0.10/node_modules/@jsr/std__yaml/_type/float.js
|
|
576
577
|
const YAML_FLOAT_PATTERN = /* @__PURE__ */ new RegExp("^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");
|
|
577
578
|
function resolveYamlFloat(data) {
|
|
578
579
|
if (!YAML_FLOAT_PATTERN.test(data) || data[data.length - 1] === "_") return false;
|
|
@@ -623,7 +624,7 @@ const float = {
|
|
|
623
624
|
};
|
|
624
625
|
|
|
625
626
|
//#endregion
|
|
626
|
-
//#region node_modules/.pnpm/@jsr+std__yaml@1.0.
|
|
627
|
+
//#region node_modules/.pnpm/@jsr+std__yaml@1.0.10/node_modules/@jsr/std__yaml/_type/int.js
|
|
627
628
|
function isCharCodeInRange(c, lower, upper) {
|
|
628
629
|
return lower <= c && c <= upper;
|
|
629
630
|
}
|
|
@@ -733,7 +734,7 @@ const int = {
|
|
|
733
734
|
};
|
|
734
735
|
|
|
735
736
|
//#endregion
|
|
736
|
-
//#region node_modules/.pnpm/@jsr+std__yaml@1.0.
|
|
737
|
+
//#region node_modules/.pnpm/@jsr+std__yaml@1.0.10/node_modules/@jsr/std__yaml/_type/map.js
|
|
737
738
|
const map = {
|
|
738
739
|
tag: "tag:yaml.org,2002:map",
|
|
739
740
|
resolve() {
|
|
@@ -746,7 +747,7 @@ const map = {
|
|
|
746
747
|
};
|
|
747
748
|
|
|
748
749
|
//#endregion
|
|
749
|
-
//#region node_modules/.pnpm/@jsr+std__yaml@1.0.
|
|
750
|
+
//#region node_modules/.pnpm/@jsr+std__yaml@1.0.10/node_modules/@jsr/std__yaml/_type/merge.js
|
|
750
751
|
const merge = {
|
|
751
752
|
tag: "tag:yaml.org,2002:merge",
|
|
752
753
|
kind: "scalar",
|
|
@@ -755,7 +756,7 @@ const merge = {
|
|
|
755
756
|
};
|
|
756
757
|
|
|
757
758
|
//#endregion
|
|
758
|
-
//#region node_modules/.pnpm/@jsr+std__yaml@1.0.
|
|
759
|
+
//#region node_modules/.pnpm/@jsr+std__yaml@1.0.10/node_modules/@jsr/std__yaml/_type/nil.js
|
|
759
760
|
const nil = {
|
|
760
761
|
tag: "tag:yaml.org,2002:null",
|
|
761
762
|
kind: "scalar",
|
|
@@ -773,7 +774,7 @@ const nil = {
|
|
|
773
774
|
};
|
|
774
775
|
|
|
775
776
|
//#endregion
|
|
776
|
-
//#region node_modules/.pnpm/@jsr+std__yaml@1.0.
|
|
777
|
+
//#region node_modules/.pnpm/@jsr+std__yaml@1.0.10/node_modules/@jsr/std__yaml/_type/omap.js
|
|
777
778
|
function resolveYamlOmap(data) {
|
|
778
779
|
const objectKeys = /* @__PURE__ */ new Set();
|
|
779
780
|
for (const object of data) {
|
|
@@ -797,7 +798,7 @@ const omap = {
|
|
|
797
798
|
};
|
|
798
799
|
|
|
799
800
|
//#endregion
|
|
800
|
-
//#region node_modules/.pnpm/@jsr+std__yaml@1.0.
|
|
801
|
+
//#region node_modules/.pnpm/@jsr+std__yaml@1.0.10/node_modules/@jsr/std__yaml/_type/pairs.js
|
|
801
802
|
function resolveYamlPairs(data) {
|
|
802
803
|
if (data === null) return true;
|
|
803
804
|
return data.every((it) => isPlainObject(it) && Object.keys(it).length === 1);
|
|
@@ -812,7 +813,7 @@ const pairs = {
|
|
|
812
813
|
};
|
|
813
814
|
|
|
814
815
|
//#endregion
|
|
815
|
-
//#region node_modules/.pnpm/@jsr+std__yaml@1.0.
|
|
816
|
+
//#region node_modules/.pnpm/@jsr+std__yaml@1.0.10/node_modules/@jsr/std__yaml/_type/regexp.js
|
|
816
817
|
const REGEXP = /^\/(?<regexp>[\s\S]+)\/(?<modifiers>[gismuy]*)$/;
|
|
817
818
|
const regexp = {
|
|
818
819
|
tag: "tag:yaml.org,2002:js/regexp",
|
|
@@ -836,7 +837,7 @@ const regexp = {
|
|
|
836
837
|
};
|
|
837
838
|
|
|
838
839
|
//#endregion
|
|
839
|
-
//#region node_modules/.pnpm/@jsr+std__yaml@1.0.
|
|
840
|
+
//#region node_modules/.pnpm/@jsr+std__yaml@1.0.10/node_modules/@jsr/std__yaml/_type/seq.js
|
|
840
841
|
const seq = {
|
|
841
842
|
tag: "tag:yaml.org,2002:seq",
|
|
842
843
|
kind: "sequence",
|
|
@@ -845,7 +846,7 @@ const seq = {
|
|
|
845
846
|
};
|
|
846
847
|
|
|
847
848
|
//#endregion
|
|
848
|
-
//#region node_modules/.pnpm/@jsr+std__yaml@1.0.
|
|
849
|
+
//#region node_modules/.pnpm/@jsr+std__yaml@1.0.10/node_modules/@jsr/std__yaml/_type/set.js
|
|
849
850
|
const set = {
|
|
850
851
|
tag: "tag:yaml.org,2002:set",
|
|
851
852
|
kind: "mapping",
|
|
@@ -857,7 +858,7 @@ const set = {
|
|
|
857
858
|
};
|
|
858
859
|
|
|
859
860
|
//#endregion
|
|
860
|
-
//#region node_modules/.pnpm/@jsr+std__yaml@1.0.
|
|
861
|
+
//#region node_modules/.pnpm/@jsr+std__yaml@1.0.10/node_modules/@jsr/std__yaml/_type/str.js
|
|
861
862
|
const str = {
|
|
862
863
|
tag: "tag:yaml.org,2002:str",
|
|
863
864
|
kind: "scalar",
|
|
@@ -866,7 +867,7 @@ const str = {
|
|
|
866
867
|
};
|
|
867
868
|
|
|
868
869
|
//#endregion
|
|
869
|
-
//#region node_modules/.pnpm/@jsr+std__yaml@1.0.
|
|
870
|
+
//#region node_modules/.pnpm/@jsr+std__yaml@1.0.10/node_modules/@jsr/std__yaml/_type/timestamp.js
|
|
870
871
|
const YAML_DATE_REGEXP = /* @__PURE__ */ new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$");
|
|
871
872
|
const YAML_TIMESTAMP_REGEXP = /* @__PURE__ */ new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");
|
|
872
873
|
function resolveYamlTimestamp(data) {
|
|
@@ -918,7 +919,7 @@ const timestamp = {
|
|
|
918
919
|
};
|
|
919
920
|
|
|
920
921
|
//#endregion
|
|
921
|
-
//#region node_modules/.pnpm/@jsr+std__yaml@1.0.
|
|
922
|
+
//#region node_modules/.pnpm/@jsr+std__yaml@1.0.10/node_modules/@jsr/std__yaml/_type/undefined.js
|
|
922
923
|
const undefinedType = {
|
|
923
924
|
tag: "tag:yaml.org,2002:js/undefined",
|
|
924
925
|
kind: "scalar",
|
|
@@ -935,7 +936,7 @@ const undefinedType = {
|
|
|
935
936
|
};
|
|
936
937
|
|
|
937
938
|
//#endregion
|
|
938
|
-
//#region node_modules/.pnpm/@jsr+std__yaml@1.0.
|
|
939
|
+
//#region node_modules/.pnpm/@jsr+std__yaml@1.0.10/node_modules/@jsr/std__yaml/_schema.js
|
|
939
940
|
function createTypeMap(implicitTypes, explicitTypes) {
|
|
940
941
|
const result = {
|
|
941
942
|
fallback: /* @__PURE__ */ new Map(),
|
|
@@ -955,11 +956,10 @@ function createSchema({ explicitTypes = [], implicitTypes = [], include }) {
|
|
|
955
956
|
implicitTypes.push(...include.implicitTypes);
|
|
956
957
|
explicitTypes.push(...include.explicitTypes);
|
|
957
958
|
}
|
|
958
|
-
const typeMap = createTypeMap(implicitTypes, explicitTypes);
|
|
959
959
|
return {
|
|
960
960
|
implicitTypes,
|
|
961
961
|
explicitTypes,
|
|
962
|
-
typeMap
|
|
962
|
+
typeMap: createTypeMap(implicitTypes, explicitTypes)
|
|
963
963
|
};
|
|
964
964
|
}
|
|
965
965
|
/**
|
|
@@ -1033,7 +1033,7 @@ const SCHEMA_MAP = new Map([
|
|
|
1033
1033
|
]);
|
|
1034
1034
|
|
|
1035
1035
|
//#endregion
|
|
1036
|
-
//#region node_modules/.pnpm/@jsr+std__yaml@1.0.
|
|
1036
|
+
//#region node_modules/.pnpm/@jsr+std__yaml@1.0.10/node_modules/@jsr/std__yaml/_loader_state.js
|
|
1037
1037
|
const CONTEXT_FLOW_IN = 1;
|
|
1038
1038
|
const CONTEXT_FLOW_OUT = 2;
|
|
1039
1039
|
const CONTEXT_BLOCK_IN = 3;
|
|
@@ -1226,8 +1226,7 @@ var LoaderState = class {
|
|
|
1226
1226
|
let ch = this.peek();
|
|
1227
1227
|
while (ch !== 0) {
|
|
1228
1228
|
if (ch !== MINUS) break;
|
|
1229
|
-
|
|
1230
|
-
if (!isWhiteSpaceOrEOL(following)) break;
|
|
1229
|
+
if (!isWhiteSpaceOrEOL(this.peek(1))) break;
|
|
1231
1230
|
detected = true;
|
|
1232
1231
|
this.position++;
|
|
1233
1232
|
if (this.skipSeparationSpace(true, -1)) {
|
|
@@ -1365,8 +1364,7 @@ var LoaderState = class {
|
|
|
1365
1364
|
following = this.peek(1);
|
|
1366
1365
|
if (isWhiteSpaceOrEOL(following) || withinFlowCollection && isFlowIndicator(following)) break;
|
|
1367
1366
|
} else if (ch === SHARP) {
|
|
1368
|
-
|
|
1369
|
-
if (isWhiteSpaceOrEOL(preceding)) break;
|
|
1367
|
+
if (isWhiteSpaceOrEOL(this.peek(-1))) break;
|
|
1370
1368
|
} else if (this.position === this.lineStart && this.testDocumentSeparator() || withinFlowCollection && isFlowIndicator(ch)) break;
|
|
1371
1369
|
else if (isEOL(ch)) {
|
|
1372
1370
|
line = this.line;
|
|
@@ -1938,7 +1936,7 @@ var LoaderState = class {
|
|
|
1938
1936
|
};
|
|
1939
1937
|
|
|
1940
1938
|
//#endregion
|
|
1941
|
-
//#region node_modules/.pnpm/@jsr+std__yaml@1.0.
|
|
1939
|
+
//#region node_modules/.pnpm/@jsr+std__yaml@1.0.10/node_modules/@jsr/std__yaml/parse.js
|
|
1942
1940
|
function sanitizeInput(input) {
|
|
1943
1941
|
input = String(input);
|
|
1944
1942
|
if (input.length > 0) {
|
|
@@ -2018,17 +2016,15 @@ var SchemaError = class extends Error {
|
|
|
2018
2016
|
};
|
|
2019
2017
|
async function loadSchemaValidator() {
|
|
2020
2018
|
const thisFile = new URL(import.meta.url);
|
|
2021
|
-
const schemaFile = join$
|
|
2019
|
+
const schemaFile = join$1(dirname(thisFile), "schema.yaml");
|
|
2022
2020
|
let content;
|
|
2023
2021
|
if (schemaFile.protocol !== "file:") content = await (await fetch(schemaFile)).text();
|
|
2024
2022
|
else content = await readFile(fromFileUrl(schemaFile), { encoding: "utf-8" });
|
|
2025
|
-
|
|
2026
|
-
return new Validator(schemaObject);
|
|
2023
|
+
return new Validator(parse(content));
|
|
2027
2024
|
}
|
|
2028
2025
|
let schemaValidator = void 0;
|
|
2029
2026
|
async function loadSchema(path) {
|
|
2030
|
-
const
|
|
2031
|
-
const schema = parse(content);
|
|
2027
|
+
const schema = parse(await readFile(path, { encoding: "utf-8" }));
|
|
2032
2028
|
if (schemaValidator == null) schemaValidator = await loadSchemaValidator();
|
|
2033
2029
|
const result = schemaValidator.validate(schema);
|
|
2034
2030
|
const errors = [];
|
|
@@ -2196,8 +2192,19 @@ const scalarTypes = {
|
|
|
2196
2192
|
&& ${v}["@id"] !== "" && ${v}["@id"] !== "/"`;
|
|
2197
2193
|
},
|
|
2198
2194
|
decoder(v) {
|
|
2199
|
-
return `${v}["@id"].startsWith("at://
|
|
2200
|
-
? new URL("at://
|
|
2195
|
+
return `${v}["@id"].startsWith("at://")
|
|
2196
|
+
? new URL("at://" +
|
|
2197
|
+
encodeURIComponent(
|
|
2198
|
+
${v}["@id"].includes("/", 5)
|
|
2199
|
+
? ${v}["@id"].slice(5, ${v}["@id"].indexOf("/", 5))
|
|
2200
|
+
: ${v}["@id"].slice(5)
|
|
2201
|
+
) +
|
|
2202
|
+
(
|
|
2203
|
+
${v}["@id"].includes("/", 5)
|
|
2204
|
+
? ${v}["@id"].slice(${v}["@id"].indexOf("/", 5))
|
|
2205
|
+
: ""
|
|
2206
|
+
)
|
|
2207
|
+
)
|
|
2201
2208
|
: new URL(${v}["@id"])`;
|
|
2202
2209
|
}
|
|
2203
2210
|
},
|
|
@@ -2551,8 +2558,7 @@ test("Object.fromJsonLd()", async () => {
|
|
|
2551
2558
|
const note = await create.getObject();
|
|
2552
2559
|
assertInstanceOf(note, Note);
|
|
2553
2560
|
assertEquals(note.content, "Content");
|
|
2554
|
-
|
|
2555
|
-
assertInstanceOf(empty, Object$1);
|
|
2561
|
+
assertInstanceOf(await Object$1.fromJsonLd({}), Object$1);
|
|
2556
2562
|
await assertRejects(() => Object$1.fromJsonLd(null), TypeError, "Invalid JSON-LD: null.");
|
|
2557
2563
|
await assertRejects(() => Object$1.fromJsonLd(void 0), TypeError, "Invalid JSON-LD: undefined.");
|
|
2558
2564
|
});
|
|
@@ -2691,8 +2697,7 @@ test("Activity.getObject()", async () => {
|
|
|
2691
2697
|
assertInstanceOf(object, Object$1);
|
|
2692
2698
|
assertEquals(object.id, new URL("https://example.com/object"));
|
|
2693
2699
|
assertEquals(object.name, "Fetched object");
|
|
2694
|
-
|
|
2695
|
-
assertEquals(jsonLd, {
|
|
2700
|
+
assertEquals(await activity.toJsonLd(), {
|
|
2696
2701
|
"@context": [
|
|
2697
2702
|
"https://w3id.org/identity/v1",
|
|
2698
2703
|
"https://www.w3.org/ns/activitystreams",
|
|
@@ -2710,8 +2715,7 @@ test("Activity.getObject()", async () => {
|
|
|
2710
2715
|
}
|
|
2711
2716
|
}
|
|
2712
2717
|
});
|
|
2713
|
-
|
|
2714
|
-
assertEquals(await activity2.getObject({ suppressError: true }), null);
|
|
2718
|
+
assertEquals(await new Activity({ object: new URL("https://example.com/not-found") }).getObject({ suppressError: true }), null);
|
|
2715
2719
|
const object3 = await (await Activity.fromJsonLd({
|
|
2716
2720
|
"@context": "https://www.w3.org/ns/activitystreams",
|
|
2717
2721
|
type: "Create",
|
|
@@ -2809,19 +2813,17 @@ test("Person.fromJsonLd()", async () => {
|
|
|
2809
2813
|
const publicKey = await person.getPublicKey({ documentLoader: mockDocumentLoader });
|
|
2810
2814
|
assertInstanceOf(publicKey, CryptographicKey);
|
|
2811
2815
|
assertEquals(publicKey?.ownerId, new URL("https://todon.eu/users/hongminhee"));
|
|
2812
|
-
|
|
2816
|
+
assertEquals((await Person.fromJsonLd({
|
|
2813
2817
|
"@context": ["https://www.w3.org/ns/activitystreams", { alsoKnownAs: {
|
|
2814
2818
|
"@id": "as:alsoKnownAs",
|
|
2815
2819
|
"@type": "@id"
|
|
2816
2820
|
} }],
|
|
2817
2821
|
"type": "Person",
|
|
2818
2822
|
"alsoKnownAs": "at://did:plc:x7xdowahlhm5xulzqw4ehv6q"
|
|
2819
|
-
});
|
|
2820
|
-
assertEquals(person2.aliasId, new URL("at://did%3Aplc%3Ax7xdowahlhm5xulzqw4ehv6q"));
|
|
2823
|
+
})).aliasId, new URL("at://did%3Aplc%3Ax7xdowahlhm5xulzqw4ehv6q"));
|
|
2821
2824
|
});
|
|
2822
2825
|
test("Person.toJsonLd()", async () => {
|
|
2823
|
-
|
|
2824
|
-
assertEquals(await person.toJsonLd(), {
|
|
2826
|
+
assertEquals(await new Person({ aliases: [new URL("https://example.com/alias")] }).toJsonLd(), {
|
|
2825
2827
|
"@context": [
|
|
2826
2828
|
"https://www.w3.org/ns/activitystreams",
|
|
2827
2829
|
"https://w3id.org/security/v1",
|
|
@@ -2906,14 +2908,11 @@ test("Note.quoteUrl", async () => {
|
|
|
2906
2908
|
_misskey_quote: "https://example.com/object2",
|
|
2907
2909
|
quoteUri: "https://example.com/object3"
|
|
2908
2910
|
};
|
|
2909
|
-
|
|
2910
|
-
assertEquals(loaded.quoteUrl, new URL("https://example.com/object"));
|
|
2911
|
+
assertEquals((await Note.fromJsonLd(jsonLd)).quoteUrl, new URL("https://example.com/object"));
|
|
2911
2912
|
delete jsonLd.quoteUrl;
|
|
2912
|
-
|
|
2913
|
-
assertEquals(loaded2.quoteUrl, new URL("https://example.com/object2"));
|
|
2913
|
+
assertEquals((await Note.fromJsonLd(jsonLd)).quoteUrl, new URL("https://example.com/object2"));
|
|
2914
2914
|
delete jsonLd._misskey_quote;
|
|
2915
|
-
|
|
2916
|
-
assertEquals(loaded3.quoteUrl, new URL("https://example.com/object3"));
|
|
2915
|
+
assertEquals((await Note.fromJsonLd(jsonLd)).quoteUrl, new URL("https://example.com/object3"));
|
|
2917
2916
|
});
|
|
2918
2917
|
test("Key.publicKey", async () => {
|
|
2919
2918
|
const jwk = {
|
|
@@ -2997,6 +2996,16 @@ test("Link.fromJsonLd()", async () => {
|
|
|
2997
2996
|
});
|
|
2998
2997
|
assertEquals(link.rel, "canonical");
|
|
2999
2998
|
assertEquals(link.href, new URL("at://did%3Aplc%3Aia76kvnndjutgedggx2ibrem/app.bsky.feed.post/3lyxjjs27jkqg"));
|
|
2999
|
+
assertEquals((await Link.fromJsonLd({
|
|
3000
|
+
"@context": "https://www.w3.org/ns/activitystreams",
|
|
3001
|
+
"type": "Link",
|
|
3002
|
+
"href": "at://bnewbold.bsky.team/app.bsky.feed.post/3jwdwj2ctlk26"
|
|
3003
|
+
})).href, new URL("at://bnewbold.bsky.team/app.bsky.feed.post/3jwdwj2ctlk26"));
|
|
3004
|
+
assertEquals((await Link.fromJsonLd({
|
|
3005
|
+
"@context": "https://www.w3.org/ns/activitystreams",
|
|
3006
|
+
"type": "Link",
|
|
3007
|
+
"href": "at://did:plc:ia76kvnndjutgedggx2ibrem"
|
|
3008
|
+
})).href, new URL("at://did%3Aplc%3Aia76kvnndjutgedggx2ibrem"));
|
|
3000
3009
|
});
|
|
3001
3010
|
function getAllProperties(type, types$1) {
|
|
3002
3011
|
const props = type.properties;
|
|
@@ -3089,8 +3098,7 @@ const sampleValues = {
|
|
|
3089
3098
|
};
|
|
3090
3099
|
const types = navigator?.userAgent === "Cloudflare-Workers" ? {} : await loadSchemaFiles(import.meta.dirname);
|
|
3091
3100
|
for (const typeUri in types) {
|
|
3092
|
-
const
|
|
3093
|
-
const cls = vocab_exports[type.name];
|
|
3101
|
+
const cls = vocab_exports[types[typeUri].name];
|
|
3094
3102
|
sampleValues[typeUri] = new cls({
|
|
3095
3103
|
"@id": "https://example.com/",
|
|
3096
3104
|
"@type": typeUri
|
|
@@ -3179,8 +3187,7 @@ for (const typeUri in types) {
|
|
|
3179
3187
|
};
|
|
3180
3188
|
if (property.functional || property.singularAccessor) test(`${type.name}.get${pascalCase(property.singularName)}() [auto]`, async () => {
|
|
3181
3189
|
const instance = new cls({ [property.singularName]: new URL("https://example.com/test") });
|
|
3182
|
-
|
|
3183
|
-
assertEquals(value, sampleValues[property.range[0]]);
|
|
3190
|
+
assertEquals(await instance[`get${pascalCase(property.singularName)}`].call(instance, { documentLoader: docLoader }), sampleValues[property.range[0]]);
|
|
3184
3191
|
if (property.untyped) return;
|
|
3185
3192
|
const wrongRef = new cls({ [property.singularName]: new URL("https://example.com/wrong-type") });
|
|
3186
3193
|
await assertRejects(() => wrongRef[`get${pascalCase(property.singularName)}`].call(wrongRef, { documentLoader: mockDocumentLoader }), TypeError);
|
|
@@ -3244,31 +3251,28 @@ for (const typeUri in types) {
|
|
|
3244
3251
|
});
|
|
3245
3252
|
assertEquals(jsonLd2["@context"], "https://www.w3.org/ns/activitystreams");
|
|
3246
3253
|
assertEquals(jsonLd2.id, "https://example.com/");
|
|
3247
|
-
|
|
3254
|
+
assertEquals(await cls.fromJsonLd(jsonLd2, {
|
|
3248
3255
|
documentLoader: mockDocumentLoader,
|
|
3249
3256
|
contextLoader: mockDocumentLoader
|
|
3250
|
-
});
|
|
3251
|
-
assertEquals(restored2, instance);
|
|
3257
|
+
}), instance);
|
|
3252
3258
|
const expanded = await instance.toJsonLd({
|
|
3253
3259
|
contextLoader: mockDocumentLoader,
|
|
3254
3260
|
format: "expand"
|
|
3255
3261
|
});
|
|
3256
|
-
|
|
3262
|
+
assertEquals(await cls.fromJsonLd(expanded, {
|
|
3257
3263
|
documentLoader: mockDocumentLoader,
|
|
3258
3264
|
contextLoader: mockDocumentLoader
|
|
3259
|
-
});
|
|
3260
|
-
assertEquals(restored3, instance);
|
|
3265
|
+
}), instance);
|
|
3261
3266
|
const instance2 = new cls({
|
|
3262
3267
|
id: new URL("https://example.com/"),
|
|
3263
3268
|
...initValues,
|
|
3264
3269
|
...globalThis.Object.fromEntries(allProperties.filter((p) => !areAllScalarTypes(p.range, types)).map((p) => p.functional ? [p.singularName, new URL("https://example.com/test")] : [p.pluralName, [new URL("https://example.com/test")]]))
|
|
3265
3270
|
});
|
|
3266
3271
|
const jsonLd3 = await instance2.toJsonLd({ contextLoader: mockDocumentLoader });
|
|
3267
|
-
|
|
3272
|
+
assertEquals(await cls.fromJsonLd(jsonLd3, {
|
|
3268
3273
|
documentLoader: mockDocumentLoader,
|
|
3269
3274
|
contextLoader: mockDocumentLoader
|
|
3270
|
-
});
|
|
3271
|
-
assertEquals(restored4, instance2);
|
|
3275
|
+
}), instance2);
|
|
3272
3276
|
assertRejects(() => instance.toJsonLd({ context: "https://www.w3.org/ns/activitystreams" }), TypeError);
|
|
3273
3277
|
assertRejects(() => instance.toJsonLd({
|
|
3274
3278
|
format: "expand",
|