@fedify/vocab-runtime 2.4.0 → 2.4.2-dev.2347
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/deno.json +1 -1
- package/dist/{contexts-BK1CqBR5.cjs → contexts-B09jb9Pi.cjs} +11 -1
- package/dist/{contexts-DPuJ4UYL.js → contexts-DWrj4AGR.js} +11 -1
- package/dist/{docloader-CYwqh5Df.d.cts → docloader-BMHljyYb.d.cts} +2 -0
- package/dist/{docloader-CYwqh5Df.d.ts → docloader-BMHljyYb.d.ts} +2 -0
- package/dist/internal/jsonld-cache.d.cts +1 -1
- package/dist/internal/jsonld-cache.d.ts +1 -1
- package/dist/internal/portable-dereference.cjs +1 -1
- package/dist/internal/portable-dereference.d.cts +2 -2
- package/dist/internal/portable-dereference.d.ts +2 -2
- package/dist/internal/portable-dereference.js +1 -1
- package/dist/internal/signed-representation.cjs +1 -1
- package/dist/internal/signed-representation.js +1 -1
- package/dist/mod.cjs +53 -4
- package/dist/mod.d.cts +30 -4
- package/dist/mod.d.ts +30 -4
- package/dist/mod.js +53 -5
- package/dist/{portable-DqtfLy_1.d.cts → portable-6Aj-7dZJ.d.cts} +1 -1
- package/dist/{portable-DtWsu2yU.d.ts → portable-nkTiqH0w.d.ts} +1 -1
- package/dist/tests/{body-CkEwROsn.cjs → body-Bywt95mV.cjs} +1 -1
- package/dist/tests/{body-CYiu9CO-.mjs → body-DhoKpS4i.mjs} +1 -1
- package/dist/tests/body.test.cjs +1 -1
- package/dist/tests/body.test.mjs +1 -1
- package/dist/tests/{contexts-DizzBjz4.cjs → contexts-C9Lj11SC.cjs} +11 -1
- package/dist/tests/{contexts-CIKsin4e.mjs → contexts-duRA_dDC.mjs} +11 -1
- package/dist/tests/decimal.test.cjs +4 -3
- package/dist/tests/decimal.test.mjs +4 -3
- package/dist/tests/{docloader-CvmS4sVq.mjs → docloader-F9eibtd-.mjs} +5 -3
- package/dist/tests/{docloader-C3YFl6y4.cjs → docloader-hc9ofEeM.cjs} +5 -3
- package/dist/tests/docloader.test.cjs +127 -3
- package/dist/tests/docloader.test.mjs +127 -3
- package/dist/tests/internal/portable-dereference.test.cjs +2 -2
- package/dist/tests/internal/portable-dereference.test.mjs +2 -2
- package/dist/tests/jsonld-CmDhHNTx.cjs +12 -0
- package/dist/tests/jsonld-DweIJ07b.mjs +5 -0
- package/dist/tests/{jsonld-cache-C07AyNOY.cjs → jsonld-cache-BEXiiM-V.cjs} +6 -17
- package/dist/tests/{jsonld-cache-BPQmOZWD.mjs → jsonld-cache-DFnWsLuZ.mjs} +2 -5
- package/dist/tests/jsonld-cache.test.cjs +13 -12
- package/dist/tests/jsonld-cache.test.mjs +2 -1
- package/dist/tests/{langstr-CQ26J_L7.mjs → langstr-DYRmJqFn.mjs} +5 -2
- package/dist/tests/{langstr-C4Fl80ae.cjs → langstr-_PqsL1ae.cjs} +5 -2
- package/dist/tests/langstr.test.cjs +8 -1
- package/dist/tests/langstr.test.mjs +9 -2
- package/dist/tests/langtag-CUppHs_s.mjs +45 -0
- package/dist/tests/langtag-Czjvxfzx.cjs +50 -0
- package/dist/tests/langtag.test.cjs +45 -0
- package/dist/tests/langtag.test.d.cts +1 -0
- package/dist/tests/langtag.test.d.mts +1 -0
- package/dist/tests/langtag.test.mjs +46 -0
- package/dist/tests/{portable-dereference-DRE5bz-l.mjs → portable-dereference-DmTYDy2p.mjs} +3 -2
- package/dist/tests/{portable-dereference-BNXtgg5U.cjs → portable-dereference-qTLMqe2_.cjs} +3 -2
- package/dist/tests/{portable-media-BLKllU56.cjs → portable-media-9D7T-9in.cjs} +2 -2
- package/dist/tests/{portable-media-DRSGBORB.mjs → portable-media-DBxgc6mz.mjs} +2 -2
- package/dist/tests/portable-media.test.cjs +1 -1
- package/dist/tests/portable-media.test.mjs +1 -1
- package/dist/tests/portable-workers.test.cjs +1 -1
- package/dist/tests/portable-workers.test.mjs +1 -1
- package/dist/tests/{request-8vPWtV1-.cjs → request-BgjEQaAz.cjs} +1 -1
- package/dist/tests/{request-DRaOaTqD.mjs → request-CVzAcZiq.mjs} +1 -1
- package/dist/tests/request.test.cjs +1 -1
- package/dist/tests/request.test.mjs +1 -1
- package/dist/tests/signed-representation.test.cjs +1 -1
- package/dist/tests/signed-representation.test.mjs +1 -1
- package/package.json +1 -1
- package/src/contexts/fep-6757.json +12 -0
- package/src/contexts/joinmastodon.json +1 -1
- package/src/contexts.ts +8 -0
- package/src/docloader.test.ts +148 -0
- package/src/docloader.ts +2 -0
- package/src/langstr.test.ts +18 -1
- package/src/langstr.ts +6 -2
- package/src/langtag.test.ts +53 -0
- package/src/langtag.ts +76 -0
- package/src/mod.ts +1 -0
package/deno.json
CHANGED
|
@@ -4438,6 +4438,16 @@ const preloadedContexts = {
|
|
|
4438
4438
|
"@type": "@id"
|
|
4439
4439
|
}
|
|
4440
4440
|
} },
|
|
4441
|
+
"https://w3id.org/fep/6757": { "@context": {
|
|
4442
|
+
"license": {
|
|
4443
|
+
"@id": "http://purl.org/dc/terms/license",
|
|
4444
|
+
"@type": "@id"
|
|
4445
|
+
},
|
|
4446
|
+
"preferredLicense": {
|
|
4447
|
+
"@id": "https://w3id.org/fep/6757#preferredLicense",
|
|
4448
|
+
"@type": "@id"
|
|
4449
|
+
}
|
|
4450
|
+
} },
|
|
4441
4451
|
"https://join-lemmy.org/context.json": { "@context": ["https://w3id.org/security/v1", {
|
|
4442
4452
|
"as": "https://www.w3.org/ns/activitystreams#",
|
|
4443
4453
|
"lemmy": "https://join-lemmy.org/ns#",
|
|
@@ -4489,7 +4499,7 @@ const preloadedContexts = {
|
|
|
4489
4499
|
"suspended": "toot:suspended",
|
|
4490
4500
|
"attributionDomains": {
|
|
4491
4501
|
"@id": "toot:attributionDomains",
|
|
4492
|
-
"@
|
|
4502
|
+
"@container": "@set"
|
|
4493
4503
|
}
|
|
4494
4504
|
} },
|
|
4495
4505
|
"https://purl.archive.org/miscellany": { "@context": {
|
|
@@ -4438,6 +4438,16 @@ const preloadedContexts = {
|
|
|
4438
4438
|
"@type": "@id"
|
|
4439
4439
|
}
|
|
4440
4440
|
} },
|
|
4441
|
+
"https://w3id.org/fep/6757": { "@context": {
|
|
4442
|
+
"license": {
|
|
4443
|
+
"@id": "http://purl.org/dc/terms/license",
|
|
4444
|
+
"@type": "@id"
|
|
4445
|
+
},
|
|
4446
|
+
"preferredLicense": {
|
|
4447
|
+
"@id": "https://w3id.org/fep/6757#preferredLicense",
|
|
4448
|
+
"@type": "@id"
|
|
4449
|
+
}
|
|
4450
|
+
} },
|
|
4441
4451
|
"https://join-lemmy.org/context.json": { "@context": ["https://w3id.org/security/v1", {
|
|
4442
4452
|
"as": "https://www.w3.org/ns/activitystreams#",
|
|
4443
4453
|
"lemmy": "https://join-lemmy.org/ns#",
|
|
@@ -4489,7 +4499,7 @@ const preloadedContexts = {
|
|
|
4489
4499
|
"suspended": "toot:suspended",
|
|
4490
4500
|
"attributionDomains": {
|
|
4491
4501
|
"@id": "toot:attributionDomains",
|
|
4492
|
-
"@
|
|
4502
|
+
"@container": "@set"
|
|
4493
4503
|
}
|
|
4494
4504
|
} },
|
|
4495
4505
|
"https://purl.archive.org/miscellany": { "@context": {
|
|
@@ -251,6 +251,8 @@ interface GetDocumentLoaderOptions extends DocumentLoaderFactoryOptions {
|
|
|
251
251
|
* - <https://w3id.org/security/multikey/v1>
|
|
252
252
|
* - <https://w3id.org/fep/ef61>
|
|
253
253
|
* - <https://w3id.org/fep/7aa9>
|
|
254
|
+
* - <https://w3id.org/fep/6757>
|
|
255
|
+
* - <https://w3id.org/fep/22cd>
|
|
254
256
|
* - <https://purl.archive.org/socialweb/webfinger>
|
|
255
257
|
* - <http://schema.org/>
|
|
256
258
|
* @param options Options for the document loader.
|
|
@@ -251,6 +251,8 @@ interface GetDocumentLoaderOptions extends DocumentLoaderFactoryOptions {
|
|
|
251
251
|
* - <https://w3id.org/security/multikey/v1>
|
|
252
252
|
* - <https://w3id.org/fep/ef61>
|
|
253
253
|
* - <https://w3id.org/fep/7aa9>
|
|
254
|
+
* - <https://w3id.org/fep/6757>
|
|
255
|
+
* - <https://w3id.org/fep/22cd>
|
|
254
256
|
* - <https://purl.archive.org/socialweb/webfinger>
|
|
255
257
|
* - <http://schema.org/>
|
|
256
258
|
* @param options Options for the document loader.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const require_contexts = require("../contexts-
|
|
3
|
+
const require_contexts = require("../contexts-B09jb9Pi.cjs");
|
|
4
4
|
const require_url = require("../url-DrGTR8yv.cjs");
|
|
5
5
|
const require_jsonld = require("../jsonld.cjs");
|
|
6
6
|
const require_internal_jsonld_cache = require("./jsonld-cache.cjs");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference lib="esnext.temporal" />
|
|
2
|
-
import { n as DocumentLoader, s as RemoteDocument } from "../docloader-
|
|
3
|
-
import { r as PortableObjectVerifier } from "../portable-
|
|
2
|
+
import { n as DocumentLoader, s as RemoteDocument } from "../docloader-BMHljyYb.cjs";
|
|
3
|
+
import { r as PortableObjectVerifier } from "../portable-6Aj-7dZJ.cjs";
|
|
4
4
|
import { Span, TracerProvider } from "@opentelemetry/api";
|
|
5
5
|
|
|
6
6
|
//#region src/internal/portable-dereference.d.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference lib="esnext.temporal" />
|
|
2
|
-
import { n as DocumentLoader, s as RemoteDocument } from "../docloader-
|
|
3
|
-
import { r as PortableObjectVerifier } from "../portable-
|
|
2
|
+
import { n as DocumentLoader, s as RemoteDocument } from "../docloader-BMHljyYb.js";
|
|
3
|
+
import { r as PortableObjectVerifier } from "../portable-nkTiqH0w.js";
|
|
4
4
|
import { Span, TracerProvider } from "@opentelemetry/api";
|
|
5
5
|
|
|
6
6
|
//#region src/internal/portable-dereference.d.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { t as preloadedContexts } from "../contexts-
|
|
2
|
+
import { t as preloadedContexts } from "../contexts-DWrj4AGR.js";
|
|
3
3
|
import { _ as parseIri, h as parseGatewayOrigin, i as canonicalizePortableUri, o as formatIri, s as fromCompatibleEf61Id, t as GATEWAY_HINT_PARAMETER, u as haveSameFe34Origin, y as toCompatibleEf61Id } from "../url-Dzyp-NsC.js";
|
|
4
4
|
import jsonld_default from "../jsonld.js";
|
|
5
5
|
import { createScopedContextLoader, registerDocumentLoaderWrapper, unwrapReleasedDocumentLoader } from "./jsonld-cache.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const require_contexts = require("../contexts-
|
|
3
|
+
const require_contexts = require("../contexts-B09jb9Pi.cjs");
|
|
4
4
|
//#region src/internal/signed-representation.ts
|
|
5
5
|
const RETAINED_SIGNED_REPRESENTATION = Symbol.for("@fedify/vocab-runtime.signedRepresentation.v1");
|
|
6
6
|
const SIGNED_VALUE_SCOPE = Symbol.for("@fedify/vocab-runtime.signedValueScope.v1");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { t as preloadedContexts } from "../contexts-
|
|
2
|
+
import { t as preloadedContexts } from "../contexts-DWrj4AGR.js";
|
|
3
3
|
//#region src/internal/signed-representation.ts
|
|
4
4
|
const RETAINED_SIGNED_REPRESENTATION = Symbol.for("@fedify/vocab-runtime.signedRepresentation.v1");
|
|
5
5
|
const SIGNED_VALUE_SCOPE = Symbol.for("@fedify/vocab-runtime.signedValueScope.v1");
|
package/dist/mod.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const require_rolldown_runtime = require("./rolldown-runtime-B7lfambq.cjs");
|
|
4
|
-
const require_contexts = require("./contexts-
|
|
4
|
+
const require_contexts = require("./contexts-B09jb9Pi.cjs");
|
|
5
5
|
const require_url = require("./url-DrGTR8yv.cjs");
|
|
6
6
|
let _logtape_logtape = require("@logtape/logtape");
|
|
7
7
|
let _opentelemetry_api = require("@opentelemetry/api");
|
|
@@ -16,7 +16,7 @@ let _multiformats_base_x = require("@multiformats/base-x");
|
|
|
16
16
|
_multiformats_base_x = require_rolldown_runtime.__toESM(_multiformats_base_x, 1);
|
|
17
17
|
//#region deno.json
|
|
18
18
|
var name = "@fedify/vocab-runtime";
|
|
19
|
-
var version = "2.4.
|
|
19
|
+
var version = "2.4.2-dev.2347+09a41add";
|
|
20
20
|
//#endregion
|
|
21
21
|
//#region src/request.ts
|
|
22
22
|
/**
|
|
@@ -674,6 +674,8 @@ function withDocumentLoaderTimeout(loader, timeout) {
|
|
|
674
674
|
* - <https://w3id.org/security/multikey/v1>
|
|
675
675
|
* - <https://w3id.org/fep/ef61>
|
|
676
676
|
* - <https://w3id.org/fep/7aa9>
|
|
677
|
+
* - <https://w3id.org/fep/6757>
|
|
678
|
+
* - <https://w3id.org/fep/22cd>
|
|
677
679
|
* - <https://purl.archive.org/socialweb/webfinger>
|
|
678
680
|
* - <http://schema.org/>
|
|
679
681
|
* @param options Options for the document loader.
|
|
@@ -1553,6 +1555,50 @@ async function verifyHashlink(bytes, hashlink) {
|
|
|
1553
1555
|
return await verifyDigestMultibase(bytes, extractDigestMultibase(hashlink));
|
|
1554
1556
|
}
|
|
1555
1557
|
//#endregion
|
|
1558
|
+
//#region src/langtag.ts
|
|
1559
|
+
const EXTLANG_PAIRS = new Set(Object.entries({
|
|
1560
|
+
ar: "aao abh abv acm acq acw acx acy adf aeb aec afb ajp apc apd arb arq ars ary arz auz avl ayh ayl ayn ayp bbz pga shu ssh",
|
|
1561
|
+
kok: "gom knn",
|
|
1562
|
+
lv: "ltg lvs",
|
|
1563
|
+
ms: "bjn btj bve bvu coa dup hji jak jax kvb kvr kxd lce lcf liw max meo mfa mfb min mqg msi mui orn ors pel pse tmw urk vkk vkt xmm zlm zmi zsm",
|
|
1564
|
+
sgn: "ads aed aen afg ajs ase asf asp asq asw bfi bfk bog bqn bqy bvl bzs cds csc csd cse csf csg csl csn csq csr csx doq dse dsl dsz dyl ecs ehs esl esn eso eth fcs fse fsl fss gds gse gsg gsm gss gus hab haf hds hks hos hps hsh hsl icl iks ils inl ins ise isg isr jcs jhs jks jls jos jsl jus kgi kvk lbs lgs lls lsb lsc lsg lsl lsn lso lsp lst lsv lsw lsy lws mdl mfs mre msd msr mzc mzg mzy nbs ncs nsi nsl nsp nsr nzs okl pgz pks prl prz psc psd psg psl pso psp psr pys rib rms rnb rsi rsl rsm rsn sdl sfb sfs sgg sgx slf sls sqk sqs sqx ssp ssr svk swl syy szs tse tsm tsq tss tsy tza ugn ugy ukl uks vgt vsi vsl vsv wbs xki xml xms yds ygs yhs ysl ysm zhk zib zsl",
|
|
1565
|
+
sw: "swc swh",
|
|
1566
|
+
uz: "uzn uzs",
|
|
1567
|
+
zh: "cdo cjy cmn cnp cpx csp czh czo gan hak hnm hsn luh lzh mnp nan sjc wuu yue"
|
|
1568
|
+
}).flatMap(([prefix, extlangs]) => extlangs.split(" ").map((extlang) => `${prefix}-${extlang}`)));
|
|
1569
|
+
const PREFIX_PATTERN = /^[A-Za-z]{2,3}$/;
|
|
1570
|
+
const EXTLANG_PATTERN = /^[A-Za-z]{3}$/;
|
|
1571
|
+
/**
|
|
1572
|
+
* Normalizes a BCP 47 language tag that has an extended language subtag
|
|
1573
|
+
* (extlang), such as `zh-yue`, into its canonical form, such as `yue`, as
|
|
1574
|
+
* described in [RFC 5646, Section 4.5][1]. `Intl.Locale` rejects extlang
|
|
1575
|
+
* tags, so tags should be normalized before being passed to it.
|
|
1576
|
+
*
|
|
1577
|
+
* Only registered extlangs that follow their registered prefix are removed;
|
|
1578
|
+
* any other tag is returned unchanged, so the result still needs to be
|
|
1579
|
+
* validated, e.g., by `Intl.Locale`.
|
|
1580
|
+
*
|
|
1581
|
+
* NOTE: This function is marked as internal in the 2.0.x–2.4.x patch
|
|
1582
|
+
* releases. When merging it into the *main* branch, remove the `@internal`
|
|
1583
|
+
* tag, formalize it as a public API (`@since 2.5.0`), and add it to
|
|
1584
|
+
* the changelog fragment.
|
|
1585
|
+
*
|
|
1586
|
+
* [1]: https://www.rfc-editor.org/rfc/rfc5646.html#section-4.5
|
|
1587
|
+
*
|
|
1588
|
+
* @param tag The BCP 47 language tag to normalize.
|
|
1589
|
+
* @returns The normalized language tag.
|
|
1590
|
+
* @internal
|
|
1591
|
+
*/
|
|
1592
|
+
function normalizeLanguageTag(tag) {
|
|
1593
|
+
const subtags = tag.split("-");
|
|
1594
|
+
if (subtags.length < 2) return tag;
|
|
1595
|
+
const [prefix, extlang, ...rest] = subtags;
|
|
1596
|
+
if (!PREFIX_PATTERN.test(prefix) || !EXTLANG_PATTERN.test(extlang)) return tag;
|
|
1597
|
+
const language = extlang.toLowerCase();
|
|
1598
|
+
if (!EXTLANG_PAIRS.has(`${prefix.toLowerCase()}-${language}`)) return tag;
|
|
1599
|
+
return [language, ...rest].join("-");
|
|
1600
|
+
}
|
|
1601
|
+
//#endregion
|
|
1556
1602
|
//#region src/langstr.ts
|
|
1557
1603
|
/**
|
|
1558
1604
|
* A language-tagged string which corresponds to the `rdf:langString` type.
|
|
@@ -1567,11 +1613,13 @@ var LanguageString = class extends String {
|
|
|
1567
1613
|
* Constructs a new `LanguageString`.
|
|
1568
1614
|
* @param value A string value written in the given language.
|
|
1569
1615
|
* @param language The language of the string. If a string is given, it will
|
|
1570
|
-
* be parsed as a `Intl.Locale` object.
|
|
1616
|
+
* be parsed as a `Intl.Locale` object. Extended language
|
|
1617
|
+
* subtags are normalized first, e.g., `zh-yue` is parsed as
|
|
1618
|
+
* `yue`.
|
|
1571
1619
|
*/
|
|
1572
1620
|
constructor(value, language) {
|
|
1573
1621
|
super(value);
|
|
1574
|
-
this.locale = typeof language === "string" ? new Intl.Locale(language) : language;
|
|
1622
|
+
this.locale = typeof language === "string" ? new Intl.Locale(normalizeLanguageTag(language)) : language;
|
|
1575
1623
|
}
|
|
1576
1624
|
};
|
|
1577
1625
|
LanguageString.prototype[Symbol.for("Deno.customInspect")] = function(inspect, options) {
|
|
@@ -1760,6 +1808,7 @@ exports.isGatewayUrl = require_url.isGatewayUrl;
|
|
|
1760
1808
|
exports.isValidPublicIPv4Address = require_url.isValidPublicIPv4Address;
|
|
1761
1809
|
exports.isValidPublicIPv6Address = require_url.isValidPublicIPv6Address;
|
|
1762
1810
|
exports.logRequest = logRequest;
|
|
1811
|
+
exports.normalizeLanguageTag = normalizeLanguageTag;
|
|
1763
1812
|
exports.parseDecimal = parseDecimal;
|
|
1764
1813
|
exports.parseDidKeyVerificationMethod = parseDidKeyVerificationMethod;
|
|
1765
1814
|
exports.parseDigestMultibase = parseDigestMultibase;
|
package/dist/mod.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference lib="esnext.temporal" />
|
|
2
|
-
import { _ as logRequest, a as DocumentLoaderOptions, c as getDocumentLoader, d as withDocumentLoaderTimeout, f as CreateRequestOptions, g as getUserAgent, h as createActivityPubRequest, i as DocumentLoaderFactoryOptions, l as getRemoteDocument, m as GetUserAgentOptions, n as DocumentLoader, o as GetDocumentLoaderOptions, p as FetchError, r as DocumentLoaderFactory, s as RemoteDocument, t as AuthenticatedDocumentLoaderFactory, u as resolveDocumentLoaderTimeout } from "./docloader-
|
|
3
|
-
import { i as PortableObjectVerifierOptions, n as PortableObjectVerification, r as PortableObjectVerifier, t as PortableObjectReferrer } from "./portable-
|
|
2
|
+
import { _ as logRequest, a as DocumentLoaderOptions, c as getDocumentLoader, d as withDocumentLoaderTimeout, f as CreateRequestOptions, g as getUserAgent, h as createActivityPubRequest, i as DocumentLoaderFactoryOptions, l as getRemoteDocument, m as GetUserAgentOptions, n as DocumentLoader, o as GetDocumentLoaderOptions, p as FetchError, r as DocumentLoaderFactory, s as RemoteDocument, t as AuthenticatedDocumentLoaderFactory, u as resolveDocumentLoaderTimeout } from "./docloader-BMHljyYb.cjs";
|
|
3
|
+
import { i as PortableObjectVerifierOptions, n as PortableObjectVerification, r as PortableObjectVerifier, t as PortableObjectReferrer } from "./portable-6Aj-7dZJ.cjs";
|
|
4
4
|
import { TracerProvider } from "@opentelemetry/api";
|
|
5
5
|
|
|
6
6
|
//#region src/contexts.d.ts
|
|
@@ -307,11 +307,37 @@ declare class LanguageString extends String {
|
|
|
307
307
|
* Constructs a new `LanguageString`.
|
|
308
308
|
* @param value A string value written in the given language.
|
|
309
309
|
* @param language The language of the string. If a string is given, it will
|
|
310
|
-
* be parsed as a `Intl.Locale` object.
|
|
310
|
+
* be parsed as a `Intl.Locale` object. Extended language
|
|
311
|
+
* subtags are normalized first, e.g., `zh-yue` is parsed as
|
|
312
|
+
* `yue`.
|
|
311
313
|
*/
|
|
312
314
|
constructor(value: string, language: Intl.Locale | string);
|
|
313
315
|
}
|
|
314
316
|
//#endregion
|
|
317
|
+
//#region src/langtag.d.ts
|
|
318
|
+
/**
|
|
319
|
+
* Normalizes a BCP 47 language tag that has an extended language subtag
|
|
320
|
+
* (extlang), such as `zh-yue`, into its canonical form, such as `yue`, as
|
|
321
|
+
* described in [RFC 5646, Section 4.5][1]. `Intl.Locale` rejects extlang
|
|
322
|
+
* tags, so tags should be normalized before being passed to it.
|
|
323
|
+
*
|
|
324
|
+
* Only registered extlangs that follow their registered prefix are removed;
|
|
325
|
+
* any other tag is returned unchanged, so the result still needs to be
|
|
326
|
+
* validated, e.g., by `Intl.Locale`.
|
|
327
|
+
*
|
|
328
|
+
* NOTE: This function is marked as internal in the 2.0.x–2.4.x patch
|
|
329
|
+
* releases. When merging it into the *main* branch, remove the `@internal`
|
|
330
|
+
* tag, formalize it as a public API (`@since 2.5.0`), and add it to
|
|
331
|
+
* the changelog fragment.
|
|
332
|
+
*
|
|
333
|
+
* [1]: https://www.rfc-editor.org/rfc/rfc5646.html#section-4.5
|
|
334
|
+
*
|
|
335
|
+
* @param tag The BCP 47 language tag to normalize.
|
|
336
|
+
* @returns The normalized language tag.
|
|
337
|
+
* @internal
|
|
338
|
+
*/
|
|
339
|
+
declare function normalizeLanguageTag(tag: string): string;
|
|
340
|
+
//#endregion
|
|
315
341
|
//#region src/portable-media.d.ts
|
|
316
342
|
/** A link or document with an external resource and its integrity digest. */
|
|
317
343
|
interface PortableMedia {
|
|
@@ -782,4 +808,4 @@ declare function isValidPublicIPv4Address(address: string): boolean;
|
|
|
782
808
|
declare function isValidPublicIPv6Address(address: string): boolean;
|
|
783
809
|
declare function expandIPv6Address(address: string): string;
|
|
784
810
|
//#endregion
|
|
785
|
-
export { type AuthenticatedDocumentLoaderFactory, type CreateRequestOptions, type Decimal, type DidKeyVerificationMethod, type DocumentLoader, type DocumentLoaderFactory, type DocumentLoaderFactoryOptions, type DocumentLoaderOptions, FetchError, type FetchPortableMediaOptions, type GetDocumentLoaderOptions, type GetUserAgentOptions, type Json, LanguageString, type ParsedDigestMultibase, type ParsedHashlink, type PortableMedia, type PortableObjectReferrer, type PortableObjectVerification, type PortableObjectVerifier, type PortableObjectVerifierOptions, type PropertyPreprocessor, type PropertyPreprocessorContext, type RemoteDocument, UrlError, arePortableUrisEqual, canParseDecimal, canonicalizePortableUri, computeDigestMultibase, createActivityPubRequest, createHashlink, decodeMultibase, encodeMultibase, encodingFromBaseData, expandIPv6Address, exportDidKey, exportMultibaseKey, exportSpki, fetchPortableMedia, formatIri, fromCompatibleEf61Id, getDocumentLoader, getFe34Origin, getGatewayHints, getRemoteDocument, getUserAgent, haveSameFe34Origin, haveSameIriOrigin, importDidKey, importMultibaseKey, importPem, importPkcs1, importSpki, isDecimal, isGatewayUrl, isValidPublicIPv4Address, isValidPublicIPv6Address, logRequest, parseDecimal, parseDidKeyVerificationMethod, parseDigestMultibase, parseGatewayUrl, parseHashlink, parseIri, parseJsonLdId, preloadedContexts, resolveDocumentLoaderTimeout, toCompatibleEf61Id, validatePublicUrl, verifyDigestMultibase, verifyHashlink, withDocumentLoaderTimeout, withGatewayHints, withoutGatewayHints };
|
|
811
|
+
export { type AuthenticatedDocumentLoaderFactory, type CreateRequestOptions, type Decimal, type DidKeyVerificationMethod, type DocumentLoader, type DocumentLoaderFactory, type DocumentLoaderFactoryOptions, type DocumentLoaderOptions, FetchError, type FetchPortableMediaOptions, type GetDocumentLoaderOptions, type GetUserAgentOptions, type Json, LanguageString, type ParsedDigestMultibase, type ParsedHashlink, type PortableMedia, type PortableObjectReferrer, type PortableObjectVerification, type PortableObjectVerifier, type PortableObjectVerifierOptions, type PropertyPreprocessor, type PropertyPreprocessorContext, type RemoteDocument, UrlError, arePortableUrisEqual, canParseDecimal, canonicalizePortableUri, computeDigestMultibase, createActivityPubRequest, createHashlink, decodeMultibase, encodeMultibase, encodingFromBaseData, expandIPv6Address, exportDidKey, exportMultibaseKey, exportSpki, fetchPortableMedia, formatIri, fromCompatibleEf61Id, getDocumentLoader, getFe34Origin, getGatewayHints, getRemoteDocument, getUserAgent, haveSameFe34Origin, haveSameIriOrigin, importDidKey, importMultibaseKey, importPem, importPkcs1, importSpki, isDecimal, isGatewayUrl, isValidPublicIPv4Address, isValidPublicIPv6Address, logRequest, normalizeLanguageTag, parseDecimal, parseDidKeyVerificationMethod, parseDigestMultibase, parseGatewayUrl, parseHashlink, parseIri, parseJsonLdId, preloadedContexts, resolveDocumentLoaderTimeout, toCompatibleEf61Id, validatePublicUrl, verifyDigestMultibase, verifyHashlink, withDocumentLoaderTimeout, withGatewayHints, withoutGatewayHints };
|
package/dist/mod.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference lib="esnext.temporal" />
|
|
2
|
-
import { _ as logRequest, a as DocumentLoaderOptions, c as getDocumentLoader, d as withDocumentLoaderTimeout, f as CreateRequestOptions, g as getUserAgent, h as createActivityPubRequest, i as DocumentLoaderFactoryOptions, l as getRemoteDocument, m as GetUserAgentOptions, n as DocumentLoader, o as GetDocumentLoaderOptions, p as FetchError, r as DocumentLoaderFactory, s as RemoteDocument, t as AuthenticatedDocumentLoaderFactory, u as resolveDocumentLoaderTimeout } from "./docloader-
|
|
3
|
-
import { i as PortableObjectVerifierOptions, n as PortableObjectVerification, r as PortableObjectVerifier, t as PortableObjectReferrer } from "./portable-
|
|
2
|
+
import { _ as logRequest, a as DocumentLoaderOptions, c as getDocumentLoader, d as withDocumentLoaderTimeout, f as CreateRequestOptions, g as getUserAgent, h as createActivityPubRequest, i as DocumentLoaderFactoryOptions, l as getRemoteDocument, m as GetUserAgentOptions, n as DocumentLoader, o as GetDocumentLoaderOptions, p as FetchError, r as DocumentLoaderFactory, s as RemoteDocument, t as AuthenticatedDocumentLoaderFactory, u as resolveDocumentLoaderTimeout } from "./docloader-BMHljyYb.js";
|
|
3
|
+
import { i as PortableObjectVerifierOptions, n as PortableObjectVerification, r as PortableObjectVerifier, t as PortableObjectReferrer } from "./portable-nkTiqH0w.js";
|
|
4
4
|
import { TracerProvider } from "@opentelemetry/api";
|
|
5
5
|
//#region src/contexts.d.ts
|
|
6
6
|
declare const preloadedContexts: Record<string, unknown>;
|
|
@@ -306,11 +306,37 @@ declare class LanguageString extends String {
|
|
|
306
306
|
* Constructs a new `LanguageString`.
|
|
307
307
|
* @param value A string value written in the given language.
|
|
308
308
|
* @param language The language of the string. If a string is given, it will
|
|
309
|
-
* be parsed as a `Intl.Locale` object.
|
|
309
|
+
* be parsed as a `Intl.Locale` object. Extended language
|
|
310
|
+
* subtags are normalized first, e.g., `zh-yue` is parsed as
|
|
311
|
+
* `yue`.
|
|
310
312
|
*/
|
|
311
313
|
constructor(value: string, language: Intl.Locale | string);
|
|
312
314
|
}
|
|
313
315
|
//#endregion
|
|
316
|
+
//#region src/langtag.d.ts
|
|
317
|
+
/**
|
|
318
|
+
* Normalizes a BCP 47 language tag that has an extended language subtag
|
|
319
|
+
* (extlang), such as `zh-yue`, into its canonical form, such as `yue`, as
|
|
320
|
+
* described in [RFC 5646, Section 4.5][1]. `Intl.Locale` rejects extlang
|
|
321
|
+
* tags, so tags should be normalized before being passed to it.
|
|
322
|
+
*
|
|
323
|
+
* Only registered extlangs that follow their registered prefix are removed;
|
|
324
|
+
* any other tag is returned unchanged, so the result still needs to be
|
|
325
|
+
* validated, e.g., by `Intl.Locale`.
|
|
326
|
+
*
|
|
327
|
+
* NOTE: This function is marked as internal in the 2.0.x–2.4.x patch
|
|
328
|
+
* releases. When merging it into the *main* branch, remove the `@internal`
|
|
329
|
+
* tag, formalize it as a public API (`@since 2.5.0`), and add it to
|
|
330
|
+
* the changelog fragment.
|
|
331
|
+
*
|
|
332
|
+
* [1]: https://www.rfc-editor.org/rfc/rfc5646.html#section-4.5
|
|
333
|
+
*
|
|
334
|
+
* @param tag The BCP 47 language tag to normalize.
|
|
335
|
+
* @returns The normalized language tag.
|
|
336
|
+
* @internal
|
|
337
|
+
*/
|
|
338
|
+
declare function normalizeLanguageTag(tag: string): string;
|
|
339
|
+
//#endregion
|
|
314
340
|
//#region src/portable-media.d.ts
|
|
315
341
|
/** A link or document with an external resource and its integrity digest. */
|
|
316
342
|
interface PortableMedia {
|
|
@@ -781,4 +807,4 @@ declare function isValidPublicIPv4Address(address: string): boolean;
|
|
|
781
807
|
declare function isValidPublicIPv6Address(address: string): boolean;
|
|
782
808
|
declare function expandIPv6Address(address: string): string;
|
|
783
809
|
//#endregion
|
|
784
|
-
export { type AuthenticatedDocumentLoaderFactory, type CreateRequestOptions, type Decimal, type DidKeyVerificationMethod, type DocumentLoader, type DocumentLoaderFactory, type DocumentLoaderFactoryOptions, type DocumentLoaderOptions, FetchError, type FetchPortableMediaOptions, type GetDocumentLoaderOptions, type GetUserAgentOptions, type Json, LanguageString, type ParsedDigestMultibase, type ParsedHashlink, type PortableMedia, type PortableObjectReferrer, type PortableObjectVerification, type PortableObjectVerifier, type PortableObjectVerifierOptions, type PropertyPreprocessor, type PropertyPreprocessorContext, type RemoteDocument, UrlError, arePortableUrisEqual, canParseDecimal, canonicalizePortableUri, computeDigestMultibase, createActivityPubRequest, createHashlink, decodeMultibase, encodeMultibase, encodingFromBaseData, expandIPv6Address, exportDidKey, exportMultibaseKey, exportSpki, fetchPortableMedia, formatIri, fromCompatibleEf61Id, getDocumentLoader, getFe34Origin, getGatewayHints, getRemoteDocument, getUserAgent, haveSameFe34Origin, haveSameIriOrigin, importDidKey, importMultibaseKey, importPem, importPkcs1, importSpki, isDecimal, isGatewayUrl, isValidPublicIPv4Address, isValidPublicIPv6Address, logRequest, parseDecimal, parseDidKeyVerificationMethod, parseDigestMultibase, parseGatewayUrl, parseHashlink, parseIri, parseJsonLdId, preloadedContexts, resolveDocumentLoaderTimeout, toCompatibleEf61Id, validatePublicUrl, verifyDigestMultibase, verifyHashlink, withDocumentLoaderTimeout, withGatewayHints, withoutGatewayHints };
|
|
810
|
+
export { type AuthenticatedDocumentLoaderFactory, type CreateRequestOptions, type Decimal, type DidKeyVerificationMethod, type DocumentLoader, type DocumentLoaderFactory, type DocumentLoaderFactoryOptions, type DocumentLoaderOptions, FetchError, type FetchPortableMediaOptions, type GetDocumentLoaderOptions, type GetUserAgentOptions, type Json, LanguageString, type ParsedDigestMultibase, type ParsedHashlink, type PortableMedia, type PortableObjectReferrer, type PortableObjectVerification, type PortableObjectVerifier, type PortableObjectVerifierOptions, type PropertyPreprocessor, type PropertyPreprocessorContext, type RemoteDocument, UrlError, arePortableUrisEqual, canParseDecimal, canonicalizePortableUri, computeDigestMultibase, createActivityPubRequest, createHashlink, decodeMultibase, encodeMultibase, encodingFromBaseData, expandIPv6Address, exportDidKey, exportMultibaseKey, exportSpki, fetchPortableMedia, formatIri, fromCompatibleEf61Id, getDocumentLoader, getFe34Origin, getGatewayHints, getRemoteDocument, getUserAgent, haveSameFe34Origin, haveSameIriOrigin, importDidKey, importMultibaseKey, importPem, importPkcs1, importSpki, isDecimal, isGatewayUrl, isValidPublicIPv4Address, isValidPublicIPv6Address, logRequest, normalizeLanguageTag, parseDecimal, parseDidKeyVerificationMethod, parseDigestMultibase, parseGatewayUrl, parseHashlink, parseIri, parseJsonLdId, preloadedContexts, resolveDocumentLoaderTimeout, toCompatibleEf61Id, validatePublicUrl, verifyDigestMultibase, verifyHashlink, withDocumentLoaderTimeout, withGatewayHints, withoutGatewayHints };
|
package/dist/mod.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { t as preloadedContexts } from "./contexts-
|
|
2
|
+
import { t as preloadedContexts } from "./contexts-DWrj4AGR.js";
|
|
3
3
|
import { S as withoutGatewayHints, _ as parseIri, a as expandIPv6Address, b as validatePublicUrl, c as getFe34Origin, d as haveSameIriOrigin, f as isGatewayUrl, g as parseGatewayUrl, i as canonicalizePortableUri, l as getGatewayHints, m as isValidPublicIPv6Address, n as UrlError, o as formatIri, p as isValidPublicIPv4Address, r as arePortableUrisEqual, s as fromCompatibleEf61Id, u as haveSameFe34Origin, v as parseJsonLdId, x as withGatewayHints, y as toCompatibleEf61Id } from "./url-Dzyp-NsC.js";
|
|
4
4
|
import { getLogger } from "@logtape/logtape";
|
|
5
5
|
import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
|
|
@@ -12,7 +12,7 @@ import { PublicKeyInfo } from "pkijs";
|
|
|
12
12
|
import baseX from "@multiformats/base-x";
|
|
13
13
|
//#region deno.json
|
|
14
14
|
var name = "@fedify/vocab-runtime";
|
|
15
|
-
var version = "2.4.
|
|
15
|
+
var version = "2.4.2-dev.2347+09a41add";
|
|
16
16
|
//#endregion
|
|
17
17
|
//#region src/request.ts
|
|
18
18
|
/**
|
|
@@ -670,6 +670,8 @@ function withDocumentLoaderTimeout(loader, timeout) {
|
|
|
670
670
|
* - <https://w3id.org/security/multikey/v1>
|
|
671
671
|
* - <https://w3id.org/fep/ef61>
|
|
672
672
|
* - <https://w3id.org/fep/7aa9>
|
|
673
|
+
* - <https://w3id.org/fep/6757>
|
|
674
|
+
* - <https://w3id.org/fep/22cd>
|
|
673
675
|
* - <https://purl.archive.org/socialweb/webfinger>
|
|
674
676
|
* - <http://schema.org/>
|
|
675
677
|
* @param options Options for the document loader.
|
|
@@ -1549,6 +1551,50 @@ async function verifyHashlink(bytes, hashlink) {
|
|
|
1549
1551
|
return await verifyDigestMultibase(bytes, extractDigestMultibase(hashlink));
|
|
1550
1552
|
}
|
|
1551
1553
|
//#endregion
|
|
1554
|
+
//#region src/langtag.ts
|
|
1555
|
+
const EXTLANG_PAIRS = new Set(Object.entries({
|
|
1556
|
+
ar: "aao abh abv acm acq acw acx acy adf aeb aec afb ajp apc apd arb arq ars ary arz auz avl ayh ayl ayn ayp bbz pga shu ssh",
|
|
1557
|
+
kok: "gom knn",
|
|
1558
|
+
lv: "ltg lvs",
|
|
1559
|
+
ms: "bjn btj bve bvu coa dup hji jak jax kvb kvr kxd lce lcf liw max meo mfa mfb min mqg msi mui orn ors pel pse tmw urk vkk vkt xmm zlm zmi zsm",
|
|
1560
|
+
sgn: "ads aed aen afg ajs ase asf asp asq asw bfi bfk bog bqn bqy bvl bzs cds csc csd cse csf csg csl csn csq csr csx doq dse dsl dsz dyl ecs ehs esl esn eso eth fcs fse fsl fss gds gse gsg gsm gss gus hab haf hds hks hos hps hsh hsl icl iks ils inl ins ise isg isr jcs jhs jks jls jos jsl jus kgi kvk lbs lgs lls lsb lsc lsg lsl lsn lso lsp lst lsv lsw lsy lws mdl mfs mre msd msr mzc mzg mzy nbs ncs nsi nsl nsp nsr nzs okl pgz pks prl prz psc psd psg psl pso psp psr pys rib rms rnb rsi rsl rsm rsn sdl sfb sfs sgg sgx slf sls sqk sqs sqx ssp ssr svk swl syy szs tse tsm tsq tss tsy tza ugn ugy ukl uks vgt vsi vsl vsv wbs xki xml xms yds ygs yhs ysl ysm zhk zib zsl",
|
|
1561
|
+
sw: "swc swh",
|
|
1562
|
+
uz: "uzn uzs",
|
|
1563
|
+
zh: "cdo cjy cmn cnp cpx csp czh czo gan hak hnm hsn luh lzh mnp nan sjc wuu yue"
|
|
1564
|
+
}).flatMap(([prefix, extlangs]) => extlangs.split(" ").map((extlang) => `${prefix}-${extlang}`)));
|
|
1565
|
+
const PREFIX_PATTERN = /^[A-Za-z]{2,3}$/;
|
|
1566
|
+
const EXTLANG_PATTERN = /^[A-Za-z]{3}$/;
|
|
1567
|
+
/**
|
|
1568
|
+
* Normalizes a BCP 47 language tag that has an extended language subtag
|
|
1569
|
+
* (extlang), such as `zh-yue`, into its canonical form, such as `yue`, as
|
|
1570
|
+
* described in [RFC 5646, Section 4.5][1]. `Intl.Locale` rejects extlang
|
|
1571
|
+
* tags, so tags should be normalized before being passed to it.
|
|
1572
|
+
*
|
|
1573
|
+
* Only registered extlangs that follow their registered prefix are removed;
|
|
1574
|
+
* any other tag is returned unchanged, so the result still needs to be
|
|
1575
|
+
* validated, e.g., by `Intl.Locale`.
|
|
1576
|
+
*
|
|
1577
|
+
* NOTE: This function is marked as internal in the 2.0.x–2.4.x patch
|
|
1578
|
+
* releases. When merging it into the *main* branch, remove the `@internal`
|
|
1579
|
+
* tag, formalize it as a public API (`@since 2.5.0`), and add it to
|
|
1580
|
+
* the changelog fragment.
|
|
1581
|
+
*
|
|
1582
|
+
* [1]: https://www.rfc-editor.org/rfc/rfc5646.html#section-4.5
|
|
1583
|
+
*
|
|
1584
|
+
* @param tag The BCP 47 language tag to normalize.
|
|
1585
|
+
* @returns The normalized language tag.
|
|
1586
|
+
* @internal
|
|
1587
|
+
*/
|
|
1588
|
+
function normalizeLanguageTag(tag) {
|
|
1589
|
+
const subtags = tag.split("-");
|
|
1590
|
+
if (subtags.length < 2) return tag;
|
|
1591
|
+
const [prefix, extlang, ...rest] = subtags;
|
|
1592
|
+
if (!PREFIX_PATTERN.test(prefix) || !EXTLANG_PATTERN.test(extlang)) return tag;
|
|
1593
|
+
const language = extlang.toLowerCase();
|
|
1594
|
+
if (!EXTLANG_PAIRS.has(`${prefix.toLowerCase()}-${language}`)) return tag;
|
|
1595
|
+
return [language, ...rest].join("-");
|
|
1596
|
+
}
|
|
1597
|
+
//#endregion
|
|
1552
1598
|
//#region src/langstr.ts
|
|
1553
1599
|
/**
|
|
1554
1600
|
* A language-tagged string which corresponds to the `rdf:langString` type.
|
|
@@ -1563,11 +1609,13 @@ var LanguageString = class extends String {
|
|
|
1563
1609
|
* Constructs a new `LanguageString`.
|
|
1564
1610
|
* @param value A string value written in the given language.
|
|
1565
1611
|
* @param language The language of the string. If a string is given, it will
|
|
1566
|
-
* be parsed as a `Intl.Locale` object.
|
|
1612
|
+
* be parsed as a `Intl.Locale` object. Extended language
|
|
1613
|
+
* subtags are normalized first, e.g., `zh-yue` is parsed as
|
|
1614
|
+
* `yue`.
|
|
1567
1615
|
*/
|
|
1568
1616
|
constructor(value, language) {
|
|
1569
1617
|
super(value);
|
|
1570
|
-
this.locale = typeof language === "string" ? new Intl.Locale(language) : language;
|
|
1618
|
+
this.locale = typeof language === "string" ? new Intl.Locale(normalizeLanguageTag(language)) : language;
|
|
1571
1619
|
}
|
|
1572
1620
|
};
|
|
1573
1621
|
LanguageString.prototype[Symbol.for("Deno.customInspect")] = function(inspect, options) {
|
|
@@ -1720,4 +1768,4 @@ async function fetchPortableMedia(media, options = {}) {
|
|
|
1720
1768
|
}, options.signal, timeout);
|
|
1721
1769
|
}
|
|
1722
1770
|
//#endregion
|
|
1723
|
-
export { FetchError, LanguageString, UrlError, arePortableUrisEqual, canParseDecimal, canonicalizePortableUri, computeDigestMultibase, createActivityPubRequest, createHashlink, decodeMultibase, encodeMultibase, encodingFromBaseData, expandIPv6Address, exportDidKey, exportMultibaseKey, exportSpki, fetchPortableMedia, formatIri, fromCompatibleEf61Id, getDocumentLoader, getFe34Origin, getGatewayHints, getRemoteDocument, getUserAgent, haveSameFe34Origin, haveSameIriOrigin, importDidKey, importMultibaseKey, importPem, importPkcs1, importSpki, isDecimal, isGatewayUrl, isValidPublicIPv4Address, isValidPublicIPv6Address, logRequest, parseDecimal, parseDidKeyVerificationMethod, parseDigestMultibase, parseGatewayUrl, parseHashlink, parseIri, parseJsonLdId, preloadedContexts, resolveDocumentLoaderTimeout, toCompatibleEf61Id, validatePublicUrl, verifyDigestMultibase, verifyHashlink, withDocumentLoaderTimeout, withGatewayHints, withoutGatewayHints };
|
|
1771
|
+
export { FetchError, LanguageString, UrlError, arePortableUrisEqual, canParseDecimal, canonicalizePortableUri, computeDigestMultibase, createActivityPubRequest, createHashlink, decodeMultibase, encodeMultibase, encodingFromBaseData, expandIPv6Address, exportDidKey, exportMultibaseKey, exportSpki, fetchPortableMedia, formatIri, fromCompatibleEf61Id, getDocumentLoader, getFe34Origin, getGatewayHints, getRemoteDocument, getUserAgent, haveSameFe34Origin, haveSameIriOrigin, importDidKey, importMultibaseKey, importPem, importPkcs1, importSpki, isDecimal, isGatewayUrl, isValidPublicIPv4Address, isValidPublicIPv6Address, logRequest, normalizeLanguageTag, parseDecimal, parseDidKeyVerificationMethod, parseDigestMultibase, parseGatewayUrl, parseHashlink, parseIri, parseJsonLdId, preloadedContexts, resolveDocumentLoaderTimeout, toCompatibleEf61Id, validatePublicUrl, verifyDigestMultibase, verifyHashlink, withDocumentLoaderTimeout, withGatewayHints, withoutGatewayHints };
|
package/dist/tests/body.test.cjs
CHANGED
package/dist/tests/body.test.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as readBoundedText, t as BodyTooLargeError } from "./body-
|
|
1
|
+
import { i as readBoundedText, t as BodyTooLargeError } from "./body-DhoKpS4i.mjs";
|
|
2
2
|
import { deepStrictEqual, ok, rejects } from "node:assert/strict";
|
|
3
3
|
import { test } from "node:test";
|
|
4
4
|
import { gunzipSync, gzipSync } from "node:zlib";
|
|
@@ -4442,6 +4442,16 @@ const preloadedContexts = {
|
|
|
4442
4442
|
"@type": "@id"
|
|
4443
4443
|
}
|
|
4444
4444
|
} },
|
|
4445
|
+
"https://w3id.org/fep/6757": { "@context": {
|
|
4446
|
+
"license": {
|
|
4447
|
+
"@id": "http://purl.org/dc/terms/license",
|
|
4448
|
+
"@type": "@id"
|
|
4449
|
+
},
|
|
4450
|
+
"preferredLicense": {
|
|
4451
|
+
"@id": "https://w3id.org/fep/6757#preferredLicense",
|
|
4452
|
+
"@type": "@id"
|
|
4453
|
+
}
|
|
4454
|
+
} },
|
|
4445
4455
|
"https://join-lemmy.org/context.json": { "@context": ["https://w3id.org/security/v1", {
|
|
4446
4456
|
"as": "https://www.w3.org/ns/activitystreams#",
|
|
4447
4457
|
"lemmy": "https://join-lemmy.org/ns#",
|
|
@@ -4493,7 +4503,7 @@ const preloadedContexts = {
|
|
|
4493
4503
|
"suspended": "toot:suspended",
|
|
4494
4504
|
"attributionDomains": {
|
|
4495
4505
|
"@id": "toot:attributionDomains",
|
|
4496
|
-
"@
|
|
4506
|
+
"@container": "@set"
|
|
4497
4507
|
}
|
|
4498
4508
|
} },
|
|
4499
4509
|
"https://purl.archive.org/miscellany": { "@context": {
|
|
@@ -4442,6 +4442,16 @@ const preloadedContexts = {
|
|
|
4442
4442
|
"@type": "@id"
|
|
4443
4443
|
}
|
|
4444
4444
|
} },
|
|
4445
|
+
"https://w3id.org/fep/6757": { "@context": {
|
|
4446
|
+
"license": {
|
|
4447
|
+
"@id": "http://purl.org/dc/terms/license",
|
|
4448
|
+
"@type": "@id"
|
|
4449
|
+
},
|
|
4450
|
+
"preferredLicense": {
|
|
4451
|
+
"@id": "https://w3id.org/fep/6757#preferredLicense",
|
|
4452
|
+
"@type": "@id"
|
|
4453
|
+
}
|
|
4454
|
+
} },
|
|
4445
4455
|
"https://join-lemmy.org/context.json": { "@context": ["https://w3id.org/security/v1", {
|
|
4446
4456
|
"as": "https://www.w3.org/ns/activitystreams#",
|
|
4447
4457
|
"lemmy": "https://join-lemmy.org/ns#",
|
|
@@ -4493,7 +4503,7 @@ const preloadedContexts = {
|
|
|
4493
4503
|
"suspended": "toot:suspended",
|
|
4494
4504
|
"attributionDomains": {
|
|
4495
4505
|
"@id": "toot:attributionDomains",
|
|
4496
|
-
"@
|
|
4506
|
+
"@container": "@set"
|
|
4497
4507
|
}
|
|
4498
4508
|
} },
|
|
4499
4509
|
"https://purl.archive.org/miscellany": { "@context": {
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
require("./url-BNakuZ8k.cjs");
|
|
2
|
-
require("./docloader-
|
|
2
|
+
require("./docloader-hc9ofEeM.cjs");
|
|
3
3
|
require("./key-C-AYkdJJ.cjs");
|
|
4
4
|
require("./multibase-B5Mea7Ip.cjs");
|
|
5
5
|
require("./digest-3FeH2Y-Q.cjs");
|
|
6
|
-
require("./
|
|
7
|
-
require("./
|
|
6
|
+
require("./langtag-Czjvxfzx.cjs");
|
|
7
|
+
require("./langstr-_PqsL1ae.cjs");
|
|
8
|
+
require("./portable-media-9D7T-9in.cjs");
|
|
8
9
|
let node_test = require("node:test");
|
|
9
10
|
let node_assert = require("node:assert");
|
|
10
11
|
//#region src/decimal.ts
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import "./url-DMxmp7ZG.mjs";
|
|
2
|
-
import "./docloader-
|
|
2
|
+
import "./docloader-F9eibtd-.mjs";
|
|
3
3
|
import "./key-C2Db_TAJ.mjs";
|
|
4
4
|
import "./multibase-BPnF_L4e.mjs";
|
|
5
5
|
import "./digest-COC7xDiQ.mjs";
|
|
6
|
-
import "./
|
|
7
|
-
import "./
|
|
6
|
+
import "./langtag-CUppHs_s.mjs";
|
|
7
|
+
import "./langstr-DYRmJqFn.mjs";
|
|
8
|
+
import "./portable-media-DBxgc6mz.mjs";
|
|
8
9
|
import { test } from "node:test";
|
|
9
10
|
import { deepStrictEqual, throws } from "node:assert";
|
|
10
11
|
//#region src/decimal.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as name, i as logRequest, n as createActivityPubRequest, o as version, t as FetchError } from "./request-
|
|
2
|
-
import { i as readBoundedText, n as MAX_BODY_SIZE, r as readBoundedBytes, t as BodyTooLargeError } from "./body-
|
|
3
|
-
import { t as preloadedContexts } from "./contexts-
|
|
1
|
+
import { a as name, i as logRequest, n as createActivityPubRequest, o as version, t as FetchError } from "./request-CVzAcZiq.mjs";
|
|
2
|
+
import { i as readBoundedText, n as MAX_BODY_SIZE, r as readBoundedBytes, t as BodyTooLargeError } from "./body-DhoKpS4i.mjs";
|
|
3
|
+
import { t as preloadedContexts } from "./contexts-duRA_dDC.mjs";
|
|
4
4
|
import { t as HttpHeaderLink } from "./link-Cevmc87v.mjs";
|
|
5
5
|
import { n as UrlError, x as validatePublicUrl } from "./url-DMxmp7ZG.mjs";
|
|
6
6
|
import { getLogger } from "@logtape/logtape";
|
|
@@ -277,6 +277,8 @@ function withDocumentLoaderTimeout(loader, timeout) {
|
|
|
277
277
|
* - <https://w3id.org/security/multikey/v1>
|
|
278
278
|
* - <https://w3id.org/fep/ef61>
|
|
279
279
|
* - <https://w3id.org/fep/7aa9>
|
|
280
|
+
* - <https://w3id.org/fep/6757>
|
|
281
|
+
* - <https://w3id.org/fep/22cd>
|
|
280
282
|
* - <https://purl.archive.org/socialweb/webfinger>
|
|
281
283
|
* - <http://schema.org/>
|
|
282
284
|
* @param options Options for the document loader.
|