@fedify/fedify 1.7.13 → 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-CsmPeeHG.js → actor-OYVgkiZG.js} +319 -455
- package/dist/{actor-BVilnhZ3.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-9g6RkEcR.js → authdocloader-C0JcfxUs.js} +7 -9
- package/dist/{authdocloader-DqCINL6u.js → authdocloader-C2krvRo1.js} +6 -8
- package/dist/{builder-CKUAOfcL.js → builder-DaECqbbT.js} +7 -7
- package/dist/{chunk-Cx8LTkjm.js → chunk-DvTpRkcT.js} +22 -15
- package/dist/{client-C5xUY491.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-aglzx1Ww.js → context-nxDPfAiA.js} +5 -5
- package/dist/{docloader-09nVWLAZ.js → docloader-BDSHZfTJ.js} +1 -1
- package/dist/{docloader-CchlnLWb.js → docloader-BU25UQLB.js} +31 -151
- package/dist/{docloader-Q42SMRIB.d.ts → docloader-D_MGP37Q.d.ts} +2 -2
- package/dist/{docloader-Qfs9nPiy.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-CP3h1SLi.js → http-BhES0Sg9.js} +23 -30
- package/dist/{http-DMTrO3Ye.d.ts → http-DFZRNfDP.d.ts} +3 -3
- package/dist/{http-CjDwMreH.js → http-DRePVWfE.js} +23 -30
- package/dist/{inbox-ApPO50Ma.js → inbox-Z_QlSGYN.js} +5 -5
- package/dist/key-CJuc1GE1.js +10 -0
- package/dist/{key--l6NVKdl.js → key-D2HZrCxh.js} +4 -4
- package/dist/{key-BPUM0v_S.js → key-bMrDyA2T.js} +5 -5
- package/dist/key-eP5Yk7hl.js +16 -0
- package/dist/{keycache-B7Urghlu.js → keycache-B5Rr8Lbc.js} +2 -2
- package/dist/{keys-DGJec4-R.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-DJTavNY3.js → ld--auFISy7.js} +9 -12
- package/dist/{lookup-CN-LpF5e.js → lookup-4uc2jh52.js} +3 -3
- package/dist/{lookup-CkOdKyYR.js → lookup-Bq8vhIG4.js} +4 -4
- package/dist/{lookup-Bf-K85bV.d.ts → lookup-CqI9jhXo.d.ts} +2 -2
- package/dist/{lookup-CnkkF4Rf.js → lookup-cHV4n1IB.js} +6 -6
- package/dist/middleware-72Tuh6Iw.js +17 -0
- package/dist/{middleware-BxHcZC4p.js → middleware-B7p-onxQ.js} +35 -39
- package/dist/middleware-DB3BUysJ.js +32 -0
- package/dist/{middleware-CEpilAEY.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-qKULzrkx.js → owner-DkTRLQAV.js} +4 -4
- package/dist/{proof-BfeWBNrY.js → proof-D4HXHDPz.js} +14 -19
- package/dist/{proof-d5P09-xk.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-BnMY3Qxa.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-BZUzjGS0.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 +90 -109
- package/dist/{vocab-S7fEn6XO.js → vocab-DCHRuBGF.js} +318 -454
- package/dist/{vocab-CzEfWQk2.d.ts → vocab-DoBcp8ow.d.ts} +2 -2
- package/dist/{vocab-C_pE4SvE.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-1Fv7reaM.js +0 -16
- package/dist/key-DD37RpoD.js +0 -10
- package/dist/middleware-BQHe0X6Y.js +0 -17
- package/dist/middleware-C3TZ3P-v.js +0 -33
- 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 = [];
|
|
@@ -2562,8 +2558,7 @@ test("Object.fromJsonLd()", async () => {
|
|
|
2562
2558
|
const note = await create.getObject();
|
|
2563
2559
|
assertInstanceOf(note, Note);
|
|
2564
2560
|
assertEquals(note.content, "Content");
|
|
2565
|
-
|
|
2566
|
-
assertInstanceOf(empty, Object$1);
|
|
2561
|
+
assertInstanceOf(await Object$1.fromJsonLd({}), Object$1);
|
|
2567
2562
|
await assertRejects(() => Object$1.fromJsonLd(null), TypeError, "Invalid JSON-LD: null.");
|
|
2568
2563
|
await assertRejects(() => Object$1.fromJsonLd(void 0), TypeError, "Invalid JSON-LD: undefined.");
|
|
2569
2564
|
});
|
|
@@ -2702,8 +2697,7 @@ test("Activity.getObject()", async () => {
|
|
|
2702
2697
|
assertInstanceOf(object, Object$1);
|
|
2703
2698
|
assertEquals(object.id, new URL("https://example.com/object"));
|
|
2704
2699
|
assertEquals(object.name, "Fetched object");
|
|
2705
|
-
|
|
2706
|
-
assertEquals(jsonLd, {
|
|
2700
|
+
assertEquals(await activity.toJsonLd(), {
|
|
2707
2701
|
"@context": [
|
|
2708
2702
|
"https://w3id.org/identity/v1",
|
|
2709
2703
|
"https://www.w3.org/ns/activitystreams",
|
|
@@ -2721,8 +2715,7 @@ test("Activity.getObject()", async () => {
|
|
|
2721
2715
|
}
|
|
2722
2716
|
}
|
|
2723
2717
|
});
|
|
2724
|
-
|
|
2725
|
-
assertEquals(await activity2.getObject({ suppressError: true }), null);
|
|
2718
|
+
assertEquals(await new Activity({ object: new URL("https://example.com/not-found") }).getObject({ suppressError: true }), null);
|
|
2726
2719
|
const object3 = await (await Activity.fromJsonLd({
|
|
2727
2720
|
"@context": "https://www.w3.org/ns/activitystreams",
|
|
2728
2721
|
type: "Create",
|
|
@@ -2820,19 +2813,17 @@ test("Person.fromJsonLd()", async () => {
|
|
|
2820
2813
|
const publicKey = await person.getPublicKey({ documentLoader: mockDocumentLoader });
|
|
2821
2814
|
assertInstanceOf(publicKey, CryptographicKey);
|
|
2822
2815
|
assertEquals(publicKey?.ownerId, new URL("https://todon.eu/users/hongminhee"));
|
|
2823
|
-
|
|
2816
|
+
assertEquals((await Person.fromJsonLd({
|
|
2824
2817
|
"@context": ["https://www.w3.org/ns/activitystreams", { alsoKnownAs: {
|
|
2825
2818
|
"@id": "as:alsoKnownAs",
|
|
2826
2819
|
"@type": "@id"
|
|
2827
2820
|
} }],
|
|
2828
2821
|
"type": "Person",
|
|
2829
2822
|
"alsoKnownAs": "at://did:plc:x7xdowahlhm5xulzqw4ehv6q"
|
|
2830
|
-
});
|
|
2831
|
-
assertEquals(person2.aliasId, new URL("at://did%3Aplc%3Ax7xdowahlhm5xulzqw4ehv6q"));
|
|
2823
|
+
})).aliasId, new URL("at://did%3Aplc%3Ax7xdowahlhm5xulzqw4ehv6q"));
|
|
2832
2824
|
});
|
|
2833
2825
|
test("Person.toJsonLd()", async () => {
|
|
2834
|
-
|
|
2835
|
-
assertEquals(await person.toJsonLd(), {
|
|
2826
|
+
assertEquals(await new Person({ aliases: [new URL("https://example.com/alias")] }).toJsonLd(), {
|
|
2836
2827
|
"@context": [
|
|
2837
2828
|
"https://www.w3.org/ns/activitystreams",
|
|
2838
2829
|
"https://w3id.org/security/v1",
|
|
@@ -2917,14 +2908,11 @@ test("Note.quoteUrl", async () => {
|
|
|
2917
2908
|
_misskey_quote: "https://example.com/object2",
|
|
2918
2909
|
quoteUri: "https://example.com/object3"
|
|
2919
2910
|
};
|
|
2920
|
-
|
|
2921
|
-
assertEquals(loaded.quoteUrl, new URL("https://example.com/object"));
|
|
2911
|
+
assertEquals((await Note.fromJsonLd(jsonLd)).quoteUrl, new URL("https://example.com/object"));
|
|
2922
2912
|
delete jsonLd.quoteUrl;
|
|
2923
|
-
|
|
2924
|
-
assertEquals(loaded2.quoteUrl, new URL("https://example.com/object2"));
|
|
2913
|
+
assertEquals((await Note.fromJsonLd(jsonLd)).quoteUrl, new URL("https://example.com/object2"));
|
|
2925
2914
|
delete jsonLd._misskey_quote;
|
|
2926
|
-
|
|
2927
|
-
assertEquals(loaded3.quoteUrl, new URL("https://example.com/object3"));
|
|
2915
|
+
assertEquals((await Note.fromJsonLd(jsonLd)).quoteUrl, new URL("https://example.com/object3"));
|
|
2928
2916
|
});
|
|
2929
2917
|
test("Key.publicKey", async () => {
|
|
2930
2918
|
const jwk = {
|
|
@@ -3008,18 +2996,16 @@ test("Link.fromJsonLd()", async () => {
|
|
|
3008
2996
|
});
|
|
3009
2997
|
assertEquals(link.rel, "canonical");
|
|
3010
2998
|
assertEquals(link.href, new URL("at://did%3Aplc%3Aia76kvnndjutgedggx2ibrem/app.bsky.feed.post/3lyxjjs27jkqg"));
|
|
3011
|
-
|
|
2999
|
+
assertEquals((await Link.fromJsonLd({
|
|
3012
3000
|
"@context": "https://www.w3.org/ns/activitystreams",
|
|
3013
3001
|
"type": "Link",
|
|
3014
3002
|
"href": "at://bnewbold.bsky.team/app.bsky.feed.post/3jwdwj2ctlk26"
|
|
3015
|
-
});
|
|
3016
|
-
assertEquals(
|
|
3017
|
-
const link3 = await Link.fromJsonLd({
|
|
3003
|
+
})).href, new URL("at://bnewbold.bsky.team/app.bsky.feed.post/3jwdwj2ctlk26"));
|
|
3004
|
+
assertEquals((await Link.fromJsonLd({
|
|
3018
3005
|
"@context": "https://www.w3.org/ns/activitystreams",
|
|
3019
3006
|
"type": "Link",
|
|
3020
3007
|
"href": "at://did:plc:ia76kvnndjutgedggx2ibrem"
|
|
3021
|
-
});
|
|
3022
|
-
assertEquals(link3.href, new URL("at://did%3Aplc%3Aia76kvnndjutgedggx2ibrem"));
|
|
3008
|
+
})).href, new URL("at://did%3Aplc%3Aia76kvnndjutgedggx2ibrem"));
|
|
3023
3009
|
});
|
|
3024
3010
|
function getAllProperties(type, types$1) {
|
|
3025
3011
|
const props = type.properties;
|
|
@@ -3112,8 +3098,7 @@ const sampleValues = {
|
|
|
3112
3098
|
};
|
|
3113
3099
|
const types = navigator?.userAgent === "Cloudflare-Workers" ? {} : await loadSchemaFiles(import.meta.dirname);
|
|
3114
3100
|
for (const typeUri in types) {
|
|
3115
|
-
const
|
|
3116
|
-
const cls = vocab_exports[type.name];
|
|
3101
|
+
const cls = vocab_exports[types[typeUri].name];
|
|
3117
3102
|
sampleValues[typeUri] = new cls({
|
|
3118
3103
|
"@id": "https://example.com/",
|
|
3119
3104
|
"@type": typeUri
|
|
@@ -3202,8 +3187,7 @@ for (const typeUri in types) {
|
|
|
3202
3187
|
};
|
|
3203
3188
|
if (property.functional || property.singularAccessor) test(`${type.name}.get${pascalCase(property.singularName)}() [auto]`, async () => {
|
|
3204
3189
|
const instance = new cls({ [property.singularName]: new URL("https://example.com/test") });
|
|
3205
|
-
|
|
3206
|
-
assertEquals(value, sampleValues[property.range[0]]);
|
|
3190
|
+
assertEquals(await instance[`get${pascalCase(property.singularName)}`].call(instance, { documentLoader: docLoader }), sampleValues[property.range[0]]);
|
|
3207
3191
|
if (property.untyped) return;
|
|
3208
3192
|
const wrongRef = new cls({ [property.singularName]: new URL("https://example.com/wrong-type") });
|
|
3209
3193
|
await assertRejects(() => wrongRef[`get${pascalCase(property.singularName)}`].call(wrongRef, { documentLoader: mockDocumentLoader }), TypeError);
|
|
@@ -3267,31 +3251,28 @@ for (const typeUri in types) {
|
|
|
3267
3251
|
});
|
|
3268
3252
|
assertEquals(jsonLd2["@context"], "https://www.w3.org/ns/activitystreams");
|
|
3269
3253
|
assertEquals(jsonLd2.id, "https://example.com/");
|
|
3270
|
-
|
|
3254
|
+
assertEquals(await cls.fromJsonLd(jsonLd2, {
|
|
3271
3255
|
documentLoader: mockDocumentLoader,
|
|
3272
3256
|
contextLoader: mockDocumentLoader
|
|
3273
|
-
});
|
|
3274
|
-
assertEquals(restored2, instance);
|
|
3257
|
+
}), instance);
|
|
3275
3258
|
const expanded = await instance.toJsonLd({
|
|
3276
3259
|
contextLoader: mockDocumentLoader,
|
|
3277
3260
|
format: "expand"
|
|
3278
3261
|
});
|
|
3279
|
-
|
|
3262
|
+
assertEquals(await cls.fromJsonLd(expanded, {
|
|
3280
3263
|
documentLoader: mockDocumentLoader,
|
|
3281
3264
|
contextLoader: mockDocumentLoader
|
|
3282
|
-
});
|
|
3283
|
-
assertEquals(restored3, instance);
|
|
3265
|
+
}), instance);
|
|
3284
3266
|
const instance2 = new cls({
|
|
3285
3267
|
id: new URL("https://example.com/"),
|
|
3286
3268
|
...initValues,
|
|
3287
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")]]))
|
|
3288
3270
|
});
|
|
3289
3271
|
const jsonLd3 = await instance2.toJsonLd({ contextLoader: mockDocumentLoader });
|
|
3290
|
-
|
|
3272
|
+
assertEquals(await cls.fromJsonLd(jsonLd3, {
|
|
3291
3273
|
documentLoader: mockDocumentLoader,
|
|
3292
3274
|
contextLoader: mockDocumentLoader
|
|
3293
|
-
});
|
|
3294
|
-
assertEquals(restored4, instance2);
|
|
3275
|
+
}), instance2);
|
|
3295
3276
|
assertRejects(() => instance.toJsonLd({ context: "https://www.w3.org/ns/activitystreams" }), TypeError);
|
|
3296
3277
|
assertRejects(() => instance.toJsonLd({
|
|
3297
3278
|
format: "expand",
|